Learning center

An action's tag moved after your run. Which code did the run execute?

A step written as uses: owner/action@v4 runs whatever commit the tag names when the job starts. Two runs of the same workflow file can execute different action code. The job's "Set up job" log records the commit each tag resolved to. Read that line for the run you rely on, compare it with the commit you trust, and pin full commit SHAs so the next run cannot drift.

Why the workflow file is not enough#

GitHub's lockfile documentation states the rule directly: without a lock, "GitHub Actions resolves that reference to whatever commit the tag or branch points to at run time." Workflow dependency lockfiles

A Git tag can be force-pushed. The secure use reference warns that "a tag can be moved or deleted if a bad actor gains access to the repository storing the action". This happened to tj-actions/changed-files in March 2025: "Attackers retroactively modified multiple version tags to reference a malicious commit, exposing CI/CD secrets in workflow logs". GHSA-mrrh-fwg8-r2c3

Moving a major tag is also routine maintenance. GitHub's release guidance for action authors tells them to update the major version tag to the latest minor or patch release. A moved tag is the normal case, and an attack is one cause among several.

What a moved tag looks like#

This fixture uses a local bare repository as the action's repository. The maintainer tags v4, then force-pushes v4 to a new commit:

$ git ls-remote origin refs/tags/v4   # Monday's run resolves
aca431d728860b65165ce85ea3d81dc911aa514d	refs/tags/v4
$ git ls-remote origin refs/tags/v4   # Tuesday's run resolves
7a4d6b808d515f1b046d57f6843f65c9428a9d53	refs/tags/v4
$ git fetch origin aca431d728860b65165ce85ea3d81dc911aa514d && git rev-parse FETCH_HEAD   # a pinned SHA
aca431d728860b65165ce85ea3d81dc911aa514d

Both runs would show @v4 in the workflow file and on the run page. Only the resolved commit tells them apart.

Read the resolution from the run#

The runner writes one line per action in the "Set up job" step. These lines come from a public job run on 2 December 2026:

Download action repository 'actions/checkout@v7' (SHA:3d3c42e5aac5ba805825da76410c181273ba90b1)
Download action repository 'actions/setup-python@v6' (SHA:ece7cb06caefa5fff74198d8649806c4678c61a1)

The runner downloads every action in the job when it starts, so a line also appears for a step that was later skipped; read the step's own log to see it ran. To pull the lines from your own job, download its log:

gh api repos/OWNER/REPO/actions/jobs/JOB_ID/logs | grep 'Download action repository'

Logs follow the repository's retention period, which defaults to 90 days. Retention for artifacts and logs Save these lines with the evidence if the run must be explained later.

What the SHA line settles#

You seeIt showsIt does not show
The SHA matches the commit you reviewedThe action's code was that commitThe code of an action that it downloads at run time, or its container image
The SHA differs from today's tagThe tag moved since that runWhether the move was a release or an attack
uses: already names a full SHAEvery run used that commitTransitive actions, which the lockfile covers

A composite action can call other actions by tag, so pinning the top-level action does not pin what it calls. GitHub's lockfile, generated with the gh actions-lock extension, also pins those transitive dependencies. It does not pin reusable workflows called with jobs.<job_id>.uses, and it does not control the runner image. Workflow dependency lockfiles

Pin the commit you reviewed#

Write the full SHA and keep the tag as a comment so updates stay readable:

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

The runner image is the other input the workflow file does not fix. See the runner image changed between two runs and protecting release tags. Return to handing over evidence.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading