Skip to content

fix(workflows): load setup action and review prompt from the called commit - #226

Merged
metalwarrior665 merged 3 commits into
masterfrom
claude/ecstatic-clarke-aq9dbh
Oct 30, 2026
Merged

metalwarrior665 merged 3 commits into
masterfrom
claude/ecstatic-clarke-aq9dbh

Conversation

@metalwarrior665

@metalwarrior665 metalwarrior665 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Tested on real repo. Claude found this new syntax. This solves 2 pains:

  1. Using workflow with commit hash (instead of tag) will actually work. Before this, it points to wrong composite action
  2. Testing a branch of this repo no longer requires chaging the tag back n forth

AI Summary

The reusable workflows hardcode uses: apify/apify-test-tools/.github/actions/checkout-restore-dependencies@workflows-v0, and public_review.yaml fetches its prompt at workflows-v0 as well. That action is also where the bundled CLI and run-with-apify-tokens.mjs come from. When a caller pins an older SHA, or points at a branch to test it from a real repo, it gets that commit's workflow YAML but the action, CLI and prompt from the current tag. Today the only way around it is to repoint every uses: at the branch and revert it before merging.

Change

  • Setup action. All five uses: now read uses: $/.github/actions/checkout-restore-dependencies. $/ is GitHub's self-repository syntax. In a reusable workflow, the runner resolves it from job.workflow_repository and job.workflow_sha, so it means this repo at the commit the caller asked for. No checkout is needed.
  • Review prompt. public_review.yaml fetches it from ${{ job.workflow_repository }} at ${{ inputs.prompt-ref || job.workflow_sha }}. prompt-ref now defaults to '' and stays available as an override.
  • Ref check removed. This deletes check-major-tag-refs.mjs and the Major tag refs job in _check_code.yaml. With $/, the workflows never name the tag. The only places left that do are usage examples in comments and docs, which get updated by hand when the major is bumped.
  • actionlint. Neither v1.7.11 nor v1.7.12 knows $/ or job.workflow_* yet: it reports "ref is missing" and "property not defined". .github/actionlint.yaml ignores those two messages for public_*.yaml. I couldn't run actionlint locally, so I matched the patterns to the error strings in actionlint's source; the Code checks run on this PR will confirm them.
  • Docs. CONTRIBUTING.md, docs/workflows.md and the comments are updated. Testing a branch is now "point the testing repo at your branch", with nothing to repoint.

Consumers don't need to change anything. @workflows-v0 keeps working the same way, since the tag commit loads its own action.

Before marking ready

  • Point testing-repo-for-github-actions at @claude/ecstatic-clarke-aq9dbh and check that public_pr-build-test resolves $/ to this branch. The runner log should download apify/apify-test-tools@<branch sha>.
  • Run public_review from the testing repo once to check the prompt fetch.
  • Confirm Code checks (actionlint) passes with the new ignores.
  • If branch protection lists Major tag refs as a required check, remove it there.

$/ needs runner 2.336.0 or newer and isn't available on GHES. That's fine for ubuntu-latest on github.com.

🤖 Generated with Claude Code

https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY

claude and others added 3 commits October 29, 2026 15:53
…ommit

The reusable workflows loaded the setup action (and with it the bundled
CLI and scripts) at the hardcoded `@workflows-v0` tag, and public_review
fetched its prompt from the same tag. A caller pinned to an older SHA,
or testing a branch, got that commit's workflow but the tag's action and
CLI.

Load the action with the `$/` self-repository syntax, which resolves to
this repo at the commit the workflow was called at, and fetch the review
prompt from `job.workflow_repository` at `job.workflow_sha`.
check-major-tag-refs.mjs now fails on a live `uses:` naming this repo.
actionlint does not know either feature yet, so those errors are ignored
for the public workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY
With the workflows loading this repo through `$/`, the only places left
that name the major tag are usage examples in comments and docs. A stale
one there misleads a reader but breaks nothing, so the check isn't worth
its own job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY
@metalwarrior665
metalwarrior665 marked this pull request as ready for review October 29, 2026 20:57
@metalwarrior665
metalwarrior665 merged commit 7524711 into master Oct 30, 2026
10 checks passed
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.

3 participants