github3.py

GitHub App access to other repositories in organization


I have a Github App created under an organization and is installed to a repository under the same organization. This app needs read access to other repositories in the same organization for fetching configuration. I tried reading a file from a different repository after authenticating using github3 login_as_app_installation API. I get below error

  File "lib/python3.6/site-packages/github3/github.py", line 1981, in repository
    json = self._json(self._get(url), 200)
  File "lib/python3.6/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
github3.exceptions.NotFoundError: 404 Not Found

But this works if I install the app to every repository where I need read access. Can I achieve this without installing the app explicitly as there is no concept of Access Token at Organization level?


Solution

  • Installation token only allows access to the repository where the app is installed. If we need access to other repositories either we need to install the app to the repository or get access to it using the personal access token