Skip to content

fix(ci): grant the merge-approval gate pull-requests: write - #303

Merged
hzcheng merged 2 commits into
mainfrom
agent-pivot/gate-comment-perm
Aug 20, 2026
Merged

fix(ci): grant the merge-approval gate pull-requests: write#303
hzcheng merged 2 commits into
mainfrom
agent-pivot/gate-comment-perm

Conversation

@hzcheng

@hzcheng hzcheng commented Aug 20, 2026

Copy link
Copy Markdown
Owner

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: write being 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-requests scope — issues: write alone is insufficient. This is the same reason actions/stale documents both scopes for PR comments. statuses: write postings are unaffected, which is why only the comment upsert failed.

One-line fix: add pull-requests: write to 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):

approve-architecture 9d8b0e6ab57351b0f48848849be5f518ec8917e9
approve 9d8b0e6ab57351b0f48848849be5f518ec8917e9

Verification

chenghongze 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.
@hzcheng
hzcheng force-pushed the agent-pivot/gate-comment-perm branch from 74bb01f to 9d8b0e6 Compare August 20, 2026 01:40
@hzcheng

hzcheng commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

approve-architecture 9d8b0e6
approve 9d8b0e6

@hzcheng
hzcheng merged commit 1edfd4e into main Aug 20, 2026
8 of 11 checks passed
@hzcheng
hzcheng deleted the agent-pivot/gate-comment-perm branch August 20, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant