Visitar URL original
Make actions/unpinned-tag lockfile- and $/-aware by nodeselector · Pull Request #22155 · github/codeql · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7fedff2
actions: stop unpinned-tag flagging $/ self-references
nodeselector Jul 10, 2026
180c109
actions: scaffold lockfile-aware pinning for unpinned-tag
nodeselector Jul 10, 2026
e80ae35
actions: add lockfile-to-data-extension generator for unpinned-tag
nodeselector Jul 10, 2026
9f8032d
actions: generate lockfile-pinned data extension during extraction
nodeselector Jul 10, 2026
9e7133b
actions: drop machine-specific replace, document lockfile generator l…
nodeselector Jul 10, 2026
d425c27
actions: keep lockfile generator go.mod free of local replace
nodeselector Jul 10, 2026
feed864
actions: rename self-reference to self repository in unpinned-tag
nodeselector Jul 10, 2026
c17aea9
actions: make lockfile-extension generation atomic
nodeselector Jul 10, 2026
287a59c
actions: drop private actions-lockfile dependency from generator
nodeselector Jul 10, 2026
b6a8394
actions: emit empty data list for zero-row lockfile extension
nodeselector Jul 10, 2026
f8f8aa8
actions/unpinned-tag: match lockfile pins case-insensitively on owner…
nodeselector Jul 13, 2026
2db34d2
actions: use US spelling in lockfile-aware pinning comments
nodeselector Jul 13, 2026
77ac6d9
actions: drop lockfile-extension generator from unpinned-tag PR
nodeselector Jul 23, 2026
91faa26
actions/unpinned-tag: normalize lockfile action identity
nodeselector Aug 31, 2026
45a6dd7
actions/unpinned-tag: regenerate expected results after sync
nodeselector Aug 31, 2026
2e04003
Actions: consume extracted lockfile pins
nodeselector Sep 2, 2026
24a18e4
Actions tests: add lockfile inline expectations
nodeselector Sep 2, 2026
e005d15
Actions tests: share inline expectations utility
nodeselector Sep 2, 2026
38f59df
Actions tests: keep inline adapter outside library API
nodeselector Sep 3, 2026
2b7e7ab
Actions lockfiles: ignore schema version value
nodeselector Sep 3, 2026
a2213ae
Actions lockfiles: match repository casing
nodeselector Sep 3, 2026
ff9bf5d
Code review suggestions
hvitved Sep 3, 2026
53a7851
Actions: address lockfile review feedback
nodeselector Sep 11, 2026
85d5925
Actions tests: move integration lockfile fixture
nodeselector Sep 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
actions: rename self-reference to self repository in unpinned-tag
Canonical terminology flip: `$/` resolves to the same REPOSITORY at the
running SHA ("self repository"), while `./` is "self workspace". Rename the
isSelfReference predicate to isSelfRepository, reword the code comment, and
update the change note (renamed to ...-self-repository.md) and test fixture
comments to match. No change to query results, the finding message, or any
.expected output.
  • Loading branch information
nodeselector committed Sep 9, 2026
commit feed86481d650f4bfcf7b6bb52d216eb1f4d1deb
10 changes: 5 additions & 5 deletions actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ private predicate isPinnedContainer(string version) {
bindingset[nwo]
private predicate isContainerImage(string nwo) { nwo.regexpMatch("^docker://.+") }

// A `$/` reference is a same-repo self-reference (e.g. `$/path/to/action`), resolved at the
// commit the calling workflow is running. Like `./` local references, it is inherently pinned
// and can never be an unpinned-tag finding, so we never flag it.
// A `$/` reference is a same-repository (self repository) reference (e.g. `$/path/to/action`),
// resolved at the commit the calling workflow is running. Like `./` local (self workspace)
// references, it is inherently pinned and can never be an unpinned-tag finding, so we never flag it.
bindingset[nwo]
private predicate isSelfReference(string nwo) { nwo.matches("$/%") }
private predicate isSelfRepository(string nwo) { nwo.matches("$/%") }

// Holds if `uses` (calling action `nwo` at `version`) is pinned by an entry in the repository's
// Actions lockfile (`.github/workflows/actions.lock`). The underlying `pinnedByLockfileDataModel`
Expand Down Expand Up @@ -70,7 +70,7 @@ where
hasUsesContainerName(uses, name) and
uses.getVersion() = version and
not isTrustedOwner(nwo) and
not isSelfReference(nwo) and
not isSelfRepository(nwo) and
not exists(UsesStep step | uses = step and pinnedByLockfile(step, nwo, version)) and
not (
if uses instanceof UsesStep and isContainerImage(nwo)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `actions/unpinned-tag` query no longer reports `$/` self repository references (e.g. `uses: $/path/to/action`), which resolve to the same repository at the running commit and are therefore inherently pinned, just like `./` self workspace (local) references.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
name: Build and test
runs-on: ubuntu-latest
steps:
# `$/` is a same-repo self-reference resolved at the running commit. It is inherently
# pinned (like `./` local refs) and must never be reported as an unpinned tag.
# `$/` is a same-repository (self repository) reference resolved at the running commit. It is
# inherently pinned (like `./` self workspace refs) and must never be reported as an unpinned tag.
- uses: $/actions/foo
# `$/…@ref` is rejected by the `$/` rule, but a user could still write it. It must also
# never be flagged; this case exercises the `not isSelfReference(nwo)` suppression, since
# never be flagged; this case exercises the `not isSelfRepository(nwo)` suppression, since
# without it `$/actions/foo@v1` would otherwise be reported as an unpinned tag.
- uses: $/actions/foo@v1