GitHub 应用程序需要哪些权限才能访问 list-issues-for-a-repository API?

Which permissions are needed for a GitHub app to access list-issues-for-a-repository API?

我想创建一个 GitHub 应用程序来显示存储库中的当前问题,按标签组织。组织下的存储库是私有的,但我的帐户具有管理员权限。我已经以我的名义安装了该应用程序。 API list-issues-for-a-repository 正在返回:

{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3/issues/#list-issues-for-a-repository"
}

我已将应用权限设置如下:

存储库权限

组织权限

用户权限

订阅活动

使用 /orgs/«org»/repos returns 空数组获取所有存储库,这意味着私有存储库未显示,因此这里也可能存在权限问题。

问题:

  1. 我需要在组织下安装应用程序吗?该组织没有显示任何已安装的应用程序,即使我们是 运行 Codacy 和 GitHub Desktop。

  2. 该应用不受组织的第三方访问策略约束。我需要添加它吗?我没有看到任何请求权限的方式,我不知道 GitHub 应用程序是否以这种方式工作。

  3. 我需要为该应用添加更多权限吗?我只需要对问题进行只读处理,不想公开超出我需要的内容。

首先,确认它必须是 "GitHub App" 而不是 "OAuth App",因为根据文档,API 用于列出存储库中的问题,仅适用于 GitHub 个应用程序。我最初犯了一个错误,记录在 的编辑历史中,选择了一个 OAuth 应用程序,但一无所获。

就我的具体问题而言:

  1. 我需要在组织下安装应用程序吗?该组织没有显示任何已安装的应用程序,即使我们是 运行 Codacy 和 GitHub Desktop。

Yes, it needs to be installed or added under the organization. It was easier for me to delete the existing app under my account, and re-add (vs re-install) under the organization.

  1. 该应用不受组织的第三方访问策略约束。我需要添加它吗?我看不到任何请求权限的方式,我不知道 GitHub 应用程序是否以这种方式工作。

Once the app is added under the organization, it is automatically given access. You can fine tune which repositories it can access or let it access them all. Installing, as opposed to adding, might need a few more steps, and the app needs to be published first. My app is intended for the organization only, so I opted for the simpler solution. Also, even if you give the app access to all repositories, the access rights of whoever logs in take precedence. For example, someone outside of the organization won't see any private repositories.

  1. 我需要为该应用添加更多权限吗?我只需要对问题进行只读处理,不想公开超出我需要的内容。

No, just read-only for issues, meta-data is included automatically.

通过这些修订,我能够访问存储库,并获得 list-issues-for-a-repository.

的结果