Use self-repository syntax for local workflow refs - #6654
Merged
Merged
Conversation
GitHub's `./...` workspace-relative syntax resolves against runner filesystem state at step-execution time, so any earlier step that writes into .github/ can substitute the workflow or action a later step runs. This matters most in run-on-pr.yml, which executes untrusted pull request code in the tests and skills-build jobs. `$/...` resolves from the repository at the caller's commit instead, is immune to workspace tampering, and counts as a pinned reference for GitHub's actions policy. It is the syntax GitHub now recommends for same-repository references. Clears 31 zizmor self-repository findings in the code scanning backlog. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6654 +/- ##
==========================================
- Coverage 78.98% 78.97% -0.01%
==========================================
Files 782 782
Lines 78065 78065
==========================================
- Hits 61658 61652 -6
- Misses 16402 16408 +6
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
uses: ./...syntax resolves against runner filesystem state at step-execution time. Any step that runs before it and can write into.github/is able to substitute the workflow or composite action that a later step executes. That is most relevant inrun-on-pr.yml, which executes untrusted pull request code in thetestsandskills-buildjobs. The./form also does not count as a pinned reference for GitHub's actions policy.zizmor/self-repositoryalerts in the code scanning backlog — every remaining zizmor finding onmain.uses:references across 6 workflows from./.github/...to$/.github/..., the syntax GitHub now recommends for same-repository references. It resolves from the repository at the caller's commit, is immune to workspace tampering, and is treated as fully pinned.No behavior change:
$/and./both resolve the called workflow from the same commit as the caller.Type of change
Test plan
Unit tests (
task test)E2E tests (
task test-e2e)Linting (
task lint-fix)Manual testing (describe below)
Verified the rewrite is exhaustive and exact:
grep -rn "uses: \./" .github/workflows/returns 0 matches,grep -rn 'uses: \$/'returns 31 — matching the 31 open alerts one-for-one.Diff is
31 insertions(+), 31 deletions(-)across 6 files, all single-token prefix changes.All workflow YAML re-parses cleanly.
This PR self-tests the change: it modifies
run-on-pr.yml, so the checks on this PR are themselves dispatched through the new$/references. A green run is direct evidence the syntax resolves.Changes
.github/workflows/run-on-pr.yml$/.github/workflows/run-on-main.yml$/.github/workflows/releaser.yml$/.github/workflows/image-build-and-publish.ymlcompute-versionaction refs →$/.github/workflows/skills-build.ymlcompute-versionaction ref →$/.github/workflows/skills-publish.ymlcompute-versionaction ref →$/Does this introduce a user-facing change?
No.
Special notes for reviewers
Two things I checked that are worth knowing:
$/is not supported on GitHub Enterprise Server. Per GitHub's docs: "This syntax is not available in GitHub Enterprise Server."stacklok/toolhiveruns on github.com so this is fine, but it would break a GHES mirror of these workflows.actionlintdoes not yet recognise$/. Version 1.7.12 reports all 25 reusable-workflow calls as malformed (is not following the format ... [workflow-call]). This does not affect CI —actionlintis not wired into any workflow or Taskfile target — but anyone running it locally will see the noise until upstream adds support.The 6
compute-versioncall sites still requireactions/checkoutto have run, since the composite action shells out togit rev-parse --short HEADin the workspace.$/changes only where the action definition is loaded from, not where its steps execute, so those call sites are unaffected.Generated with Claude Code