Repository navigation
fix(workflows): load setup action and review prompt from the called commit - #226
Merged
Merged
Conversation
…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
marked this pull request as ready for review
October 29, 2026 20:57
metalwarrior665
requested review from
JuanGalilea and
ruocco-l
as code owners
October 29, 2026 20:57
ruocco-l
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested on real repo. Claude found this new syntax. This solves 2 pains:
AI Summary
The reusable workflows hardcode
uses: apify/apify-test-tools/.github/actions/checkout-restore-dependencies@workflows-v0, andpublic_review.yamlfetches its prompt atworkflows-v0as well. That action is also where the bundled CLI andrun-with-apify-tokens.mjscome 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 everyuses:at the branch and revert it before merging.Change
uses:now readuses: $/.github/actions/checkout-restore-dependencies.$/is GitHub's self-repository syntax. In a reusable workflow, the runner resolves it fromjob.workflow_repositoryandjob.workflow_sha, so it means this repo at the commit the caller asked for. No checkout is needed.public_review.yamlfetches it from${{ job.workflow_repository }}at${{ inputs.prompt-ref || job.workflow_sha }}.prompt-refnow defaults to''and stays available as an override.check-major-tag-refs.mjsand theMajor tag refsjob 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.$/orjob.workflow_*yet: it reports "ref is missing" and "property not defined"..github/actionlint.yamlignores those two messages forpublic_*.yaml. I couldn't run actionlint locally, so I matched the patterns to the error strings in actionlint's source; theCode checksrun on this PR will confirm them.Consumers don't need to change anything.
@workflows-v0keeps working the same way, since the tag commit loads its own action.Before marking ready
@claude/ecstatic-clarke-aq9dbhand check thatpublic_pr-build-testresolves$/to this branch. The runner log should downloadapify/apify-test-tools@<branch sha>.public_reviewfrom the testing repo once to check the prompt fetch.Code checks(actionlint) passes with the new ignores.Major tag refsas a required check, remove it there.$/needs runner 2.336.0 or newer and isn't available on GHES. That's fine forubuntu-lateston github.com.🤖 Generated with Claude Code
https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY