Advise --relock for composite-held exact tags behind their commit by nodeselector · Pull Request #221 · github/gh-actions-lock · GitHub
Skip to content

Advise --relock for composite-held exact tags behind their commit - #221

Merged
nodeselector merged 1 commit into
mainfrom
nodeselector-composite-relock-advice
Oct 21, 2026
Merged

nodeselector merged 1 commit into
mainfrom
nodeselector-composite-relock-advice

Conversation

@nodeselector

Copy link
Copy Markdown
Collaborator
  • Since Verify and rebuild complete transitive lock graphs #214, --relock rebuilds composite closures from live manifests, so a composite-held exact tag that is locked behind its commit is now relocked at the tag's commit. The advice now says to run gh actions-lock --relock and no longer says that only upgrading the composite helps. The README is updated to match.
  • TestParity_ExactTagBehindInCompositeNamesHolder, which has been failing on main, is replaced by a test that runs --relock, checks it writes the tag's commit, and then checks --verify passes.

Since --relock rebuilds composite closures from live manifests, it locks a
composite-held exact tag at the tag's commit. Drop the advice that it only
helps once the composite advances, and test the repair end to end.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nodeselector
nodeselector requested a review from a team as a code owner October 21, 2026 05:37
Copilot AI max review requested due to automatic review settings October 21, 2026 05:37
@nodeselector
nodeselector merged commit 5a1469a into main Oct 21, 2026
11 of 12 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

2 open issues
What changed in this PR

Updates --relock guidance and behavior expectations so exact-tag entries locked behind a tag can be repaired via relock, including when referenced from within a composite action.

Changes:

  • Update tag/commit mismatch remediation text to recommend gh actions-lock --relock more broadly.
  • Adjust parity test to assert that --relock repairs an exact-tag-behind scenario originating from a composite action reference.
  • Refresh README documentation to match the updated --relock behavior.
File Description
internal/​pipeline/​checks/​misleading.go Updates remediation messaging for tag/commit mismatch findings.
cmd/​gh-actions-lock/​parity_test.go Updates parity test name and assertions to validate --relock repairs composite-held exact-tag mismatch.
README.md Updates docs to state --relock can resolve tag-commit mismatch even for composite-pinned entries.

Review effort: Lite

Comment on lines +2996 to +2998
assert.Contains(t, string(after), "'actions/checkout@v7.0.1':\n ref: 'v7.0.1'\n commit: 'sha1-"+parityTestMoved+"'", "the tag's commit is written")
assert.NotContains(t, string(after), parityTestSHA, "the older commit is not")
assert.Contains(t, string(after), "sha1-"+rootSHA, "the composite keeps its commit")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants