Skip to content

fix(automerge): drop checks:read from reusable, document caller opt-in#28

Merged
topcoder1 merged 1 commit into
mainfrom
fix/checks-read-in-caller-not-reusable
May 3, 2026
Merged

fix(automerge): drop checks:read from reusable, document caller opt-in#28
topcoder1 merged 1 commit into
mainfrom
fix/checks-read-in-caller-not-reusable

Conversation

@topcoder1

Copy link
Copy Markdown
Owner

Hot-fix to #27. The checks: read permission I added to the reusable's job-level block creates a cap-mismatch with existing fleet callers — they grant only contents+pull-requests at the workflow level, and GitHub fails the workflow at startup_failure before any step runs.

Caught on whois-api-llc/wxa-mcp-server#80, run 25292746179: the auto-merge install PR's first run after the fix landed showed empty job list + startup_failure conclusion. The signature of a permissions-cap conflict at workflow start.

Without this revert, every existing Claude PR on every fleet repo (44+ callers) would startup_failure on its next run. Bad outcome.

Fix

  • Drop checks: read from the reusable's job-level permissions.
  • Keep the graceful 403 handling in the Option B step from fix(automerge): grant checks:read + harden Codex bypass against API errors #27 (gh api ... || echo '{}' + jq 'try (...) // empty'). Without checks:read, the step gracefully returns bypass=0 — Option A (label bypass) and the no-risky-paths fast-path still work.
  • Update the caller template at ~/.claude/templates/ci-workflows/callers/claude-author-automerge.yml to grant checks: read. New fleet installs get Option B by default.

Migration for existing 44 callers

Existing callers continue to work after this lands. To opt in to Option B, they add a one-line checks: read to their workflow-level permissions block. I'll ship that as a fleet-wide migration in a separate PR (probably scripted via gh api for batch).

Test plan

  • actionlint clean.
  • Post-merge: re-trigger wxa-mcp-server#80 → expect Claude-author Auto-merge to NOT startup_failure (it'll go through the normal risk-tier check, find .github/workflows/** is a risk path, post the blocked comment as designed).

Auto-merge rationale: NOT eligible — touches .github/workflows/**. Manual click-merge.

Codex pre-review: skipped — straight revert + comment update.

🤖 Generated with Claude Code

Previous fix (#27) added `checks: read` to the reusable's job-level
permissions to make Option B work. But that's a *cap-mismatch* with
the 44+ existing fleet callers that only grant contents+pull-requests
at the workflow level — when the reusable is called from those, GitHub
fails the workflow at startup with `startup_failure`, before any step
runs.

Caught on whois-api-llc/wxa-mcp-server#80, run 25292746179: the install
PR's auto-merge workflow had startup_failure with empty job list (the
signature of a permissions-cap conflict at workflow start).

The fix: keep the graceful 403 handling in the Option B step (already
done in #27) but DON'T request `checks: read` from the reusable.
Callers that want Option B should add `checks: read` to their own
workflow-level permissions block. The graceful step returns bypass=0
when the permission is missing — so callers without it keep working
on Option A (label bypass) and the no-risky-paths path.

Updated caller template at
~/.claude/templates/ci-workflows/callers/claude-author-automerge.yml
to grant `checks: read` so new fleet installs get Option B by default.

Existing 44 fleet callers continue to work after this lands. They
opt into Option B by adding `checks: read` (one-line change). I'll
ship that as a fleet-wide migration in a separate PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@topcoder1
topcoder1 enabled auto-merge (squash) May 3, 2026 22:43
@claude

claude Bot commented May 3, 2026

Copy link
Copy Markdown

No issues found. Pure permissions-block comment change — dropping checks: read from the reusable is the correct fix for the startup_failure cap-mismatch, and the graceful 403 degradation from #27 is already in place.

@topcoder1
topcoder1 merged commit b79c10b into main May 3, 2026
4 checks passed
@topcoder1
topcoder1 deleted the fix/checks-read-in-caller-not-reusable branch May 3, 2026 22:45
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