You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
claim bot: on a fork PR the label and the explanation fail with HTTP 403, so the author never sees why the check failed #34
On a pull request from a fork, the claim bot cannot write. The pull_request event from a fork gets a read-only GITHUB_TOKEN, even though the caller job in obs-rust/obs-studio asks for issues: write and pull-requests: write. When the bot finds a claim conflict, it cannot add the label and cannot post its explanation:
obs-rust/obs-studio#5547: label_add 'claim-conflict'
##[warning]obs-rust/obs-studio#5547: label_add failed: gh kept failing: POST repos/obs-rust/obs-studio/issues/5547/labels -> HTTP 403: gh: Resource not accessible by integration (HTTP 403)
##[warning]obs-rust/obs-studio#5547: comment failed: gh kept failing: POST repos/obs-rust/obs-studio/issues/5547/comments -> HTTP 403: gh: Resource not accessible by integration (HTTP 403)
The check goes red, but the author does not see why. On #5547 the cause was that the hourly sweep had unassigned the author from obs-rust/obs-studio#5134 after 24 hours without progress. Only a maintainer who read the job log could find this. A maintainer /reassign and a rerun of the bot fixed it.
Expected
A fork contributor sees why the claim check failed and what to do (for example, "comment Claiming: #5134 on the issue"), without help from a maintainer.
Possible fixes
Write the explanation to the job step summary ($GITHUB_STEP_SUMMARY) and as an error annotation when a write returns HTTP 403. The author can read it from the failed check. This needs no new token scope.
Run the PR check for forks from a pull_request_target caller, which gets a write token. The bot must then never check out or run code from the PR head.
Leave the label and comment to the hourly sweep (schedule event, write token), and make the PR check only report.
Option 1 is the smallest change and is safe. Option 2 or 3 also gets the label and the comment onto the PR.
RED: a test in tests/ where the PR check's label or comment write returns HTTP 403 and expects the explanation in the step summary and as an ::error:: annotation.
GREEN: claim_bot.py writes the explanation it could not post to $GITHUB_STEP_SUMMARY and as an error annotation (option 1 of the issue). No new token scope.
Activity
vpacher commentedon Nov 25, 2026
Claiming: #34
Plan (one PR):
tests/where the PR check's label or comment write returns HTTP 403 and expects the explanation in the step summary and as an::error::annotation.claim_bot.pywrites the explanation it could not post to$GITHUB_STEP_SUMMARYand as an error annotation (option 1 of the issue). No new token scope.First PR expected today.
fix: a PR claim check that runs after the merge writes nothing (Fixes #…