Skip to content

Commit b1165b5

Browse files
committed
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.
1 parent 75dc432 commit b1165b5

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ private predicate isPinnedContainer(string version) {
3333
bindingset[nwo]
3434
private predicate isContainerImage(string nwo) { nwo.regexpMatch("^docker://.+") }
3535

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

4242
// Holds if `uses` (calling action `nwo` at `version`) is pinned by an entry in the repository's
4343
// Actions lockfile (`.github/workflows/actions.lock`). The underlying `pinnedByLockfileDataModel`
@@ -70,7 +70,7 @@ where
7070
getStepContainerName(uses, name) and
7171
uses.getVersion() = version and
7272
not isTrustedOwner(nwo) and
73-
not isSelfReference(nwo) and
73+
not isSelfRepository(nwo) and
7474
not pinnedByLockfile(uses, nwo, version) and
7575
not (if isContainerImage(nwo) then isPinnedContainer(version) else isPinnedCommit(version)) and
7676
not isImmutableAction(uses, nwo)

actions/ql/src/change-notes/2026-07-09-unpinned-tag-self-reference.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* 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.

actions/ql/test/query-tests/Security/CWE-829/.github/workflows/self_ref_dollar.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ jobs:
66
name: Build and test
77
runs-on: ubuntu-latest
88
steps:
9-
# `$/` is a same-repo self-reference resolved at the running commit. It is inherently
10-
# pinned (like `./` local refs) and must never be reported as an unpinned tag.
9+
# `$/` is a same-repository (self repository) reference resolved at the running commit. It is
10+
# inherently pinned (like `./` self workspace refs) and must never be reported as an unpinned tag.
1111
- uses: $/actions/foo
1212
# `$/…@ref` is rejected by the `$/` rule, but a user could still write it. It must also
13-
# never be flagged; this case exercises the `not isSelfReference(nwo)` suppression, since
13+
# never be flagged; this case exercises the `not isSelfRepository(nwo)` suppression, since
1414
# without it `$/actions/foo@v1` would otherwise be reported as an unpinned tag.
1515
- uses: $/actions/foo@v1

0 commit comments

Comments
 (0)