Pinning actions to a full commit SHA protects against moved tags. The price: a single wrong character and GitHub cannot find the version – the run fails before any step runs.
Symptom
gh run view <ID> --log | grep -o 'Unable to resolve action.*' Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b2`, unable to find version `3d3c42e5aac5ba805825da76410c181273ba90b2`
The workflow says uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b2 # v7.0.1.
Diagnosis
Query the real SHA of the tag and compare it with the one in the workflow.
gh api repos/actions/checkout/commits/v7.0.1 --jq .sha 3d3c42e5aac5ba805825da76410c181273ba90b1
Causes
…ba90b2Typo in the SHA
The last character is wrong: …ba90b2 instead of …ba90b1. That commit does not exist in the action's repository.
typed by handCopying SHAs manually
Nobody types 40 hex characters without a mistake. Fetch the value via the API or let Renovate/Dependabot set it.
Fix
sed -i 's/ba90b2 # v7.0.1/ba90b1 # v7.0.1/' .github/workflows/wk.yml gh workflow run wk.yml https://github.com/<du>/notes-actions/actions/runs/41634532754
Don't: Switch back to @v7 because the SHA is annoying – a tag can point to a different commit at any time.
GitHub Actions hands-on, Day 15: find and fix eight broken workflows against the clock.
Go to day 15 →
FAQ
Why pin by SHA at all?
A tag like v7 can be moved; a compromised repository could bring foreign code into your runs that way. A commit SHA is immutable.
How do pinned actions stay up to date?
Renovate or Dependabot update the SHA and the version comment via pull request.