Skip to content

Accept the self-repository prefix $/ like ./ for actions and job-level reusable workflow calls #75910

Done

Description

@nmeisenzahl

What happens

GitHub Actions supports the self-repository syntax: uses: $/path in a step names an action in the repository of the running workflow, at that workflow's own commit, and uses: $/.github/workflows/<file>.yml does the same for a job-level reusable workflow call (changelog). A $/ reference takes no @ref.

gh aw v1.0.1 refuses both forms, also in a workflow with strict: false:

  • A step with uses: $/some/action, in the agent job's steps, in a custom job or in safe-outputs.jobs, stops the compile with:

    error: imported steps: unversioned action "$/some/action" has no available pin; add a @ref (e.g. @v1) or include it in action-pins.json
    

    applyActionPinToTypedStep in pkg/workflow/action_pins.go passes only ./ and docker:// through without a pin. v1.2.1 and main behave the same.

  • A custom job with uses: $/.github/workflows/called.yml fails the action-pin lint rule:

    CTR-002: [action-pin] Malformed action or reusable-workflow reference; use a repository-relative path, a remote reference pinned to a full commit SHA, or an action image pinned to a digest at jobs.<job>.uses
    

    integrityReference in pkg/workflow/lint/integrity.go knows ./, docker:// and owner/repo@ref. A malformed reference is an error whatever strict says, so the only way past it is threat-detection-suppress for the whole rule.

Why it matters

A compiled workflow that other repositories call with workflow_call often needs actions from its own repository at its own commit. In a step, ./ names the caller's workspace, a checkout of the calling repository, so it can run a file of the caller with the same path instead of the intended action. $/ is the documented way to reach the called workflow's own repository, also when both repositories are private. A pin to owner/repo@sha works too, but the SHA of a release is only known after the release commit exists, so it cannot be written into the source.

For job-level calls, ./.github/workflows/<file>.yml already resolves to the calling workflow's repository and commit, so there $/ and ./ behave the same in our tests. Accepting $/ keeps one spelling for both levels.

Proposal

  • In applyActionPinToTypedStep, treat a uses: that starts with $/ like one that starts with ./: leave it as written, with no pin lookup and no @ref.
  • In integrityReference, accept $/ followed by a repository-relative path, with the same path checks as ./, and for a reusable workflow the same .github/workflows/<file>.yml check.

How to reproduce

  1. A workflow .github/workflows/demo.md with on: workflow_call, strict: false and a steps: entry uses: $/some/action, where some/action/action.yml exists in the repository.
  2. Run gh aw compile: the first error above.
  3. Replace the step with a custom job call: { needs: activation, uses: $/.github/workflows/called.yml }, where called.yml is a plain reusable workflow: the second error above.

Tested with gh aw v1.0.1 on 2026-11-08.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions