code: def get_extra_metadata(gh, owner, repo_name, ref):
      
      try:
          content = gh.repository(owner, repo_name).file_contents(
              path=current_app.config['GITHUB_METADATA_FILE'], ref=ref
          )
          if not content:
              # File does not exists in the given ref
              return {}
          return json.loads(content.decoded.decode('utf-8'))
      except ValueError:
          raise CustomGitHubMetadataError(
              u'Metadata file "{file}" is not valid JSON.'
              .format(file=current_app.config['GITHUB_METADATA_FILE'])
          )
docs: Get the metadata file.