Skip to content

resolveReviewThread requires contents:write — pull_requests:write alone is insufficient for GitHub App installation tokens #35726

Closed

Description

@maxknv

Summary

The resolveReviewThread GraphQL mutation returns Resource not accessible by integration (FORBIDDEN) for GitHub App installation tokens that have pull_requests: write but only contents: read. Adding contents: write to the token's permission set makes the mutation succeed.

This is reproducible with the following token permission sets:

Token permissions Result
pull_requests: write, contents: read ❌ FORBIDDEN
pull_requests: write, contents: write ✅ Success

Reproduction

Mint a GitHub App installation token with:

{
  "contents": "read",
  "pull_requests": "write",
  "issues": "write",
  "metadata": "read",
  "statuses": "write"
}

Then run:

gh api graphql -f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{isResolved}}}' -f threadId=<thread-id>

Result:

{"data":{"resolveReviewThread":null},"errors":[{"type":"FORBIDDEN","message":"Resource not accessible by integration"}]}

Bumping contents to write makes it succeed.

Why this looks like a bug

resolveReviewThread is a pull request review action with no logical relationship to repository file contents. The correct permission to gate this mutation should be pull_requests: write only. The contents permission controls read/write access to files, trees, and blobs — not review thread state.

Related

Similar symptom (FORBIDDEN on resolveReviewThread with pull-requests: write) was reported in #33137, where the root cause was attributed to bot identity restrictions. The contents: write requirement identified here is a separate, more specific finding.

Activity

  1. locked and limited conversation to collaborators on May 29, 2026
  2. unlocked this conversation on May 29, 2026
  3. zarenner commented on Jun 12, 2026

    @zarenner
    Collaborator

    The Pull Requests team has indicated this is likely intentional (at least at the time it was added), as the rationale was that resolving a thread should align with merge-level permissions (repo write access), not just PR metadata permissions, because it signals "this concern is addressed" which is a gatekeeping action. They said however it may be worth revisiting in the context of Apps and fine-grained permissions. Nothing further at this time.

  4. muhqu commented on Nov 10, 2026

    @muhqu

    @zarenner I think there's a useful distinction to draw here. A GitHub App usually doesn't need to resolve review threads in general, or approve anything. It only needs to dismiss or resolve the review comments it posted itself.

    Take a PR review bot that posts findings as inline code comments. When the PR author pushes new commits that fix those findings, the bot should be able to clean up its own outdated comments automatically. Today that only works if the bot also gets contents: write. That's far more access than a bot that only reviews should have, since it could then push code to the repository.

    Could resolving or dismissing your own review threads be gated by pull_requests: write alone, with broader thread resolution kept behind stronger permissions?

  5. locked and limited conversation to collaborators on Nov 10, 2026
  6. unlocked this conversation on Nov 10, 2026
  7. tl-carlos-rosa commented on Nov 10, 2026

    @tl-carlos-rosa

    @zarenner I think there's a useful distinction to draw here. A GitHub App usually doesn't need to resolve review threads in general, or approve anything. It only needs to dismiss or resolve the review comments it posted itself.

    Take a PR review bot that posts findings as inline code comments. When the PR author pushes new commits that fix those findings, the bot should be able to clean up its own outdated comments automatically. Today that only works if the bot also gets contents: write. That's far more access than a bot that only reviews should have, since it could then push code to the repository.

    Could resolving or dismissing your own review threads be gated by pull_requests: write alone, with broader thread resolution kept behind stronger permissions?

    Same exact concern in regard to Review bots. They can mark the comments as outdated but cannot resolve those threads. It becomes a bit of busywork to the have to resolve those threads automatically if repo has "Require conversation resolution before merging"

  8. locked and limited conversation to collaborators on Nov 10, 2026
  9. unlocked this conversation on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions