fix(ci): grant the merge-approval gate pull-requests: write - #303
Merged
Conversation
added 2 commits
August 20, 2026 09:39
…ft report comment The gate's standing impact-report comment 403s with 'Resource not accessible by integration' although issues: write is declared: for the Actions token, the issue-comments endpoint on a pull request is governed by the pull-requests scope (the same reason actions/stale documents both scopes for PR comments). statuses: write postings are unaffected, which is why only the comment upsert failed. Also make the report comment upsert fail-soft: the comment is an advisory review aid — its delivery failure must never block the verdict status. Fail-closed covers the verdict, not the review aid. A wiring test pins the try/catch.
Skill-Harvest: none
hzcheng
force-pushed
the
agent-pivot/gate-comment-perm
branch
from
August 20, 2026 01:40
74bb01f to
9d8b0e6
Compare
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Also makes the report-comment upsert fail-soft (advisory review aid must never block the verdict status) — without this, the 403 would take down the merge-approval gate for every PR.
PR #300's merge-approval gate replacement (standing impact-report comment) 403s in CI: 'Resource not accessible by integration' on POST /issues/N/comments, despite
issues: writebeing granted (confirmed in the job's GITHUB_TOKEN permissions dump).Root cause: for the Actions token, the issue-comments endpoint on a pull request is governed by the
pull-requestsscope —issues: writealone is insufficient. This is the same reason actions/stale documents both scopes for PR comments.statuses: writepostings are unaffected, which is why only the comment upsert failed.One-line fix: add
pull-requests: writeto the gate workflow permissions.Skill harvest
no skill change — the failure is a GitHub token-scope subtlety, fixed in place.
Owner approvals
Copy each line into a separate PR comment below (both bind the exact head SHA and expire when the head moves):
Verification
node --test tests/unit/tooling/mergeApprovalGate.test.js— 5/5 passnode scripts/check-behavior-contracts.js— pass