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
fix(ci): checkout the event SHA, not refs/pull/<n>/merge, in governance jobs
The 8 governance-reusable.yml jobs that pass `ref: ${{ github.ref }}` to
actions/checkout were failing at checkout on every PR with
"couldn't find remote ref refs/pull/<n>/merge".
Root cause: governance.yml triggers on pull_request and calls
governance-reusable.yml via workflow_call. In a reusable workflow,
github.ref inherits the caller's PR ref, which is the named merge ref
refs/pull/<n>/merge. actions/checkout cannot fetch that named ref, so the
8 jobs that requested it died at checkout — leaving governance effectively
ungated on PRs (only push-to-main runs were enforcing). The two jobs that
omit an explicit ref (workflow-staleness, validate-hypatia-baseline) were
unaffected, matching the observed 8/10 failure.
Fix: pin those checkouts to `ref: ${{ github.sha }}` — the concrete event
commit (the PR merge commit on pull_request, the pushed commit on push).
github.sha resolves to the same merge commit refs/pull/<n>/merge points
at, but is always fetchable. Content is unchanged; the diff-based jobs
(quality trufflehog base/head) already use explicit SHAs, so enforcement
semantics are preserved. The secondary `ref: main` checkouts that pull the
standards check scripts are untouched.
Estate-wide: re-enables PR-time governance enforcement across all repos
that consume this reusable workflow. Owner-approved 2026-06-27.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MJdfXv5E5gwGD2yaJq8jRM
0 commit comments