mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #68] [MERGED] fix(pr-size): mint bot token with pull-requests:write and degrade on runtime 403 (BE-4385) #77
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/68
Author: @mattmillerai
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/26/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-4385-pr-size-pr-write📝 Commits (2)
2cd82fffix(pr-size): mint bot token with pull-requests:write and degrade on runtime 403 (BE-4385)7454a68fix(pr-size): soften post-failed diagnosis to point at upsert log (BE-4385)📊 Changes
1 file changed (+24 additions, -7 deletions)
View changed files
📝
.github/workflows/pr-size.yml(+24 -7)📄 Description
ELI-5
When a pull request is too big, a bot leaves a comment saying so. To leave that comment the bot needs a key with the right permission. We were minting the key with the "Issues" permission, but a comment on a pull request actually needs the "Pull requests" permission — GitHub treats PR comments through the same endpoint as issue comments, and for GitHub Apps that endpoint checks the Pull requests scope. So the comment 403'd on every PR. This swaps the requested scope to
pull-requests: write, and also makes the comment step fail-soft: if posting still can't happen (e.g. the app isn't granted the permission yet on that install), the check stays green and the full size report still shows up in the job's step summary instead of turning the check red.What changed
.github/workflows/pr-size.yml, thecommentjob:permission-pull-requests: writeinstead ofpermission-issues: write. The issue-comments API on a pull request checks the app's Pull requests permission for GitHub Apps, so that is the one scope required (read is implied for the list-comments GET).issues:writewas both wrong (didn't grant PR-comment access) and, if kept alongside, an ungranted extra that 422s the mint — this workflow only ever comments on pull requests.continue-on-error: trueandid: upsert. Design intent already stated in the file is that the comment path "must degrade to status + summary, never get a red check"; today only the mint step was guarded, so a runtime 403 (proven live on Jul-24 after an Issues grant) escaped it and reddened the check. "Note degraded mode" now also fires onsteps.upsert.outcome == 'failure'with a message pointing at the likely missing Pull requests permission and the step-summary report.Why it's safe / notable
continue-on-erroron the mint step) and degrades to a green check with no comment — i.e. the pre-2026-07-24 behavior that unblocks merges. Once the grant lands, comments post correctly.steps.upsert.outcome == 'failure'in the degraded-mode gate. This relies on GitHub Actions semantics:outcomereflects the step result beforecontinue-on-erroris applied (which only rewritesconclusiontosuccess), so a tolerated 403 still reads asoutcome == 'failure'. This mirrors the existingsteps.bot.outcome == 'success'guard on the already-tolerated mint step. When the upsert step is skipped (bot mint didn't succeed), its outcome isskipped, notfailure, so that path correctly falls through to the existing creds-absent/mint-failed message.uses:were added, so all actions stay SHA-pinned (zizmor clean).actionlintpasses (it runs shellcheck over the embedded run scripts).test-pr-size.ymlandscripts/check-pr-size/contain no assertions on the mint permissions or the comment-job step layout (they cover the Go counting logic only), so nothing to update.groom.yml'spermission-issuesuses are unrelated — groom files GitHub issues, not PR comments — and were left untouched.Verification
actionlint .github/workflows/pr-size.yml→ clean.bump-pr-size-callers.ymlpath filter includes.github/workflows/pr-size.yml, so the merge should fire the caller-bump run and open the SHA-bump PR in the caller repo (the delivery vehicle, tracked by the sibling cloud ticket).This is not a capability-denial change (it adds tolerance and degrades gracefully), so the negative-claim falsification discipline does not apply.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.