Keep lockfiles that record a tag containing @ loadable by nodeselector · Pull Request #217 · github/gh-actions-lock · GitHub
Skip to content

Keep lockfiles that record a tag containing @ loadable - #217

Merged
nodeselector merged 2 commits into
mainfrom
nodeselector-transitive-lock-graphs-f92
Oct 21, 2026
Merged

nodeselector merged 2 commits into
mainfrom
nodeselector-transitive-lock-graphs-f92

Conversation

@nodeselector

@nodeselector nodeselector commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator
  • A lockfile entry may again record a tag or branch containing @ (for example predicate@2.0.0, which a composite's SHA-pinned child can resolve to); only a uses: ref, and so a lockfile key, can't contain @.
  • Reverse lookup still records such a tag for a full-SHA pin, but leaves the uses: on the SHA instead of rewriting it to the tag.
  • Lockfiles written for actions with monorepo-style tags load and verify again.

An entry may record a tag such as predicate@2.0.0, which the Actions
backend accepts as an entry ref, so loading a lockfile that records one
must keep working. Only a `uses:` can't name it: reverse lookup now keeps
such a use's SHA instead of rewriting it to the tag.

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 04:29
Copilot AI max review requested due to automatic review settings October 21, 2026 04:29
@nodeselector
nodeselector force-pushed the nodeselector-transitive-lock-graphs-f92 branch from 2fbca95 to 5551e74 Compare October 21, 2026 04:29
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nodeselector
nodeselector merged commit 1370c18 into main Oct 21, 2026
11 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

1 open issue
What changed in this PR

Updates reverse lookup and lockfile verification to support recording tags that contain @ (e.g., predicate@2.0.0) while ensuring workflow uses: references remain valid.

Changes:

  • Prevent reverse-lookup rewrites to tag/branch names containing @, keeping SHA-based uses: intact.
  • Allow @ in recorded ref/tag metadata and adjust validation accordingly.
  • Add tests covering recorded tags containing @ across resolver, lockfile loading, and --verify-local.
File Description
internal/​resolve/​reverse_lookup_test.go Adds resolver test ensuring tags containing @ are recorded but do not trigger uses: rewrites away from SHA.
internal/​resolve/​reverse_lookup.go Skips rewrites when the candidate ref contains @ to avoid generating invalid uses: refs.
internal/​lockfile/​state_test.go Adds test ensuring lockfile load preserves recorded tags containing @ for SHA-keyed entries.
internal/​ghapi/​refname_test.go Updates accepted ref-name tests to treat predicate@2.0.0 as acceptable.
internal/​ghapi/​refname.go Changes AcceptedRefName to allow @ in ref names (removes prior restriction).
cmd/​gh-actions-lock/​command_test.go Adds --verify-local test for lockfiles that record a tag containing @ on a SHA-pinned dependency.

Review effort: Lite

Comment thread internal/ghapi/refname.go
Comment on lines 74 to 78
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