GitHub App gets 403 when commenting on one external public repository but not another #214134
Replies: 2 comments
|
Thank you for your interest in contributing to our community! We currently only accept discussions created through the GitHub UI using our provided discussion templates. Please re-submit your discussion by navigating to the appropriate category and using the template provided. This discussion has been closed because it was not submitted through the expected format. If you believe this was a mistake, please reach out to the maintainers. |
|
It depends on where the app is installed, not only on the repository being public. From the docs on acting on behalf of a user, a GitHub App token can only write to a repository when all three of these are true:
Being public only gives the app read access. Writing, which includes creating comments, still needs an installation on the owner's account. That's where So the external repo that works almost certainly belongs to an account where your app is installed, for example the owner installed it, or it's an org that installed it. The failing one doesn't have it. How to check # with a JWT for your app: 200 = installed on that repo, 404 = not installed
curl -H "Authorization: Bearer $APP_JWT" \
https://api.github.com/repos/OWNER/REPO/installationAlso check which token you're sending. Options
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm using a GitHub App that can create issues and comments in one external public repository, but commenting on an issue in another external public repository returns
403: Resource not accessible by integration.Both repositories are public, and the issues are open and unlocked. My reported repository permissions are identical. The app has Issues write permission and access to my own repositories. Commenting via my personal GitHub CLI OAuth authentication works in the affected repository.
What determines whether a GitHub App can comment on issues in external public repositories? Does this depend on the app being installed by the target repository owner, or on the use of a user access token versus an installation access token? How can I diagnose the difference?
Thanks!
All reactions