Skip to content

fix(actionlint): use github.workflow_ref (not workflow_sha) for cross-repo checkout - #21

Merged
blairham merged 1 commit into
mainfrom
fix/actionlint-cross-repo-ref
Jun 17, 2026
Merged

fix(actionlint): use github.workflow_ref (not workflow_sha) for cross-repo checkout#21
blairham merged 1 commit into
mainfrom
fix/actionlint-cross-repo-ref

Conversation

@blairham

Copy link
Copy Markdown
Contributor

Summary

validate-reusable-inputs vendors pinpredict/.github at the workflow's own ref so that uses: ./<vendored> resolves against this repo rather than the caller. The previous revision (commit 73a31ca) used ref: \${{ github.workflow_sha }}, on the assumption that workflow_sha is "the @ref SHA when invoked from a downstream caller." It isn't — in cross-repo reusable calls, github.workflow_sha returns the caller's head SHA, so actions/checkout fails with not our ref <caller-sha> when trying to fetch it from pinpredict/.github.

Switch to parsing github.workflow_ref. Shape:

<owner>/<repo>/.github/workflows/<file>.yml@<git-ref>

Splitting on @ yields a ref actions/checkout resolves against this repo — refs/heads/main for downstream @main callers, refs/pull/N/merge for self-CI PRs, a SHA when pinned.

Observed impact

Live failures since 73a31ca rolled out (2026-06-08):

Test plan

  • Self-CI on this PR passes (proves the fix doesn't break the self-CI path).
  • After merge, re-run CI on `trading-reports#5` and `service-template#12` — both should go green on `validate-reusable-inputs`.

🤖 Generated with Claude Code

…-repo checkout

`validate-reusable-inputs` vendors pinpredict/.github at the workflow's
own ref to resolve `uses: ./...` against this repo (not the caller).
The previous revision used `github.workflow_sha`, which in cross-repo
reusable calls returns the *caller's* head SHA — fine for self-CI
(caller and this repo are the same) but breaks every downstream
consumer with `not our ref <caller-sha>` when actions/checkout tries
to fetch the caller's SHA from pinpredict/.github.

Parse `github.workflow_ref` instead — its shape is
`<owner>/<repo>/.github/workflows/<file>.yml@<git-ref>` — and pass the
ref portion to actions/checkout. Resolves to `refs/heads/main` for
downstream `@main` callers, `refs/pull/N/merge` for self-CI PRs, and
the SHA when pinned.

Observed failures: every CI run on trading-reports main since #4
merged; service-template PR #12 (the first PR since the actionlint
shim landed).
@blairham
blairham merged commit 14512a6 into main Jun 17, 2026
2 checks passed
@blairham
blairham deleted the fix/actionlint-cross-repo-ref branch July 5, 2026 14:37
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