Skip to content

Grant checks:read + statuses:read so the CI gate can read checks on private repos#13

Merged
bbkrr merged 1 commit into
mainfrom
fix/gate-checks-read-permission
Jul 15, 2026
Merged

Grant checks:read + statuses:read so the CI gate can read checks on private repos#13
bbkrr merged 1 commit into
mainfrom
fix/gate-checks-read-permission

Conversation

@bbkrr

@bbkrr bbkrr commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #12 (Refs #11).

Problem. #12 switched the gate to read checks authoritatively from the REST Checks API (commits/{sha}/check-runs) plus legacy commit statuses. But the workflow's permissions: block only grants contents/pull-requests/issues/models. With a permissions block present, any unlisted scope defaults to none, so checks and statuses were none. On a private repo those REST reads return 403, which the gate correctly treats as an unreadable-checks error — so it fails safe and never merges.

Observed live on realrate/EBA#100 (private): the post-#12 auto-merge run sat in the gate loop retrying __ERR__ instead of merging a green patch bump. It never mis-merges (the failure mode is safe), but it won't complete the merge.

Fix. Grant checks: read and statuses: read (both read-only) in the workflow permissions. The gate can then see the PR's checks and merge green patch/minor bumps as intended. No tooling change.

Public repos were unaffected (their checks are world-readable), which is why the earlier public-repo runs merged fine.

🤖 Generated with Claude Code

The CI gate (gated_merge.sh, #12) now reads checks authoritatively from the
REST Checks API (commits/{sha}/check-runs) and legacy commit statuses
(commits/{sha}/status). The workflow's `permissions:` block did not grant
`checks`/`statuses`, and with a permissions block present any unlisted scope
defaults to `none`. On a PRIVATE repo those reads then 403, which the gate
treats as an unreadable-checks error -- so it fails safe and never merges
(observed on realrate/EBA#100: gate looped on `__ERR__` until timeout).

Granting both read scopes lets the gate see the PR's checks and merge green
patch/minor bumps as intended. Both are read-only.

Refs #11.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bbkrr
bbkrr merged commit ca4e09d into main Jul 15, 2026
1 check passed
@bbkrr
bbkrr deleted the fix/gate-checks-read-permission branch July 15, 2026 08:23
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