GitHub Actions uses with both ref and path is invalid
A uses value is either a local path (./path, no @ref) or a remote reference (owner/repo@ref). Mixing them - a local path with an @ref - is not a valid action reference.
What this error means
The workflow fails to resolve the action, reporting an invalid uses value, after a local action path was written with an @ref suffix.
github-actions
Invalid workflow file: ./.github/actions/build@v1
Local actions cannot specify a ref (use './.github/actions/build').Common causes
Local path with @ref
Local actions are read from the checked-out commit; an @ref is meaningless and invalid.
Remote action missing @ref
Conversely, a remote owner/repo reference must include an @ref.
How to fix it
Use the correct uses form
- For local actions: uses: ./.github/actions/build with no @ref.
- For remote actions: uses: owner/repo@v1 (or a pinned SHA).
- Checkout the repo before using a local action so the path exists.
.github/workflows/ci.yml
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build # local, no refHow to prevent it
- Pin remote actions to a SHA or tag; never add a ref to local paths.
- Run actionlint to catch malformed uses values.
Related guides
GitHub Actions container action requires uses with a Dockerfile/imageFix a GitHub Actions Docker container action that fails because runs.using is docker but no image or Dockerfi…
GitHub Actions composite action inputs not passedFix a GitHub Actions composite action whose inputs are empty - composite steps must reference inputs via the…
GitHub Actions "Workflow does not exist" (workflow_dispatch on non-default branch)Fix "Workflow does not exist" when dispatching - workflow_dispatch is only available once the workflow file e…