-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Make actions/unpinned-tag lockfile- and $/-aware #22155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nodeselector
wants to merge
15
commits into
github:main
Choose a base branch
from
nodeselector:nodeselector-actions-lockfile-aware-pinning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
83a2ac1
actions: stop unpinned-tag flagging $/ self-references
nodeselector c58cbad
actions: scaffold lockfile-aware pinning for unpinned-tag
nodeselector 0acf589
actions: add lockfile-to-data-extension generator for unpinned-tag
nodeselector 5e990c7
actions: generate lockfile-pinned data extension during extraction
nodeselector 7b2a8d1
actions: drop machine-specific replace, document lockfile generator l…
nodeselector b3082dd
actions: keep lockfile generator go.mod free of local replace
nodeselector 99a6458
actions: rename self-reference to self repository in unpinned-tag
nodeselector 29e0be6
actions: make lockfile-extension generation atomic
nodeselector 002c86f
actions: drop private actions-lockfile dependency from generator
nodeselector af291ff
actions: emit empty data list for zero-row lockfile extension
nodeselector 142ebaf
actions/unpinned-tag: match lockfile pins case-insensitively on owner…
nodeselector fab9b47
actions: use US spelling in lockfile-aware pinning comments
nodeselector c8f5f3c
actions: drop lockfile-extension generator from unpinned-tag PR
nodeselector 70b4e9b
actions/unpinned-tag: normalize lockfile action identity
nodeselector f1e28c2
actions/unpinned-tag: regenerate expected results after sync
nodeselector File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| category: minorAnalysis | ||
| --- | ||
| * Added a new extensible predicate `pinnedByLockfileDataModel(workflow_path, nwo, ref)`, which lets model packs record `uses:` references pinned by a repository's Actions lockfile (`.github/workflows/actions.lock`). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
actions/ql/src/change-notes/2026-07-09-unpinned-tag-lockfile-aware.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| category: minorAnalysis | ||
| --- | ||
| * The `actions/unpinned-tag` query no longer reports `uses:` references recorded by the new `pinnedByLockfileDataModel` extensible predicate. Lockfile pins match repository sub-actions while preserving ref casing. |
4 changes: 4 additions & 0 deletions
4
actions/ql/src/change-notes/2026-07-09-unpinned-tag-self-repository.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
actions/ql/test/query-tests/Security/CWE-829/.github/workflows/lockfile_pinned.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| on: | ||
| pull_request | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build and test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # `some-owner/pinned-action@v1` is a tag ref that would normally be reported as an unpinned | ||
| # tag. The test data extension `pinned_by_lockfile.model.yml` records it as pinned by the | ||
| # repository's Actions lockfile, so the `not pinnedByLockfile(...)` clause suppresses it (this | ||
| # fixture is expected to produce no findings). This mirrors data supplied by an external | ||
| # model pack generated from `.github/workflows/actions.lock`. | ||
| # | ||
| # Negative control is provided for free by the many other fixtures in this directory whose tag | ||
| # refs are NOT recorded in the data extension and therefore remain reported. | ||
| - uses: some-owner/pinned-action@v1 | ||
| # `Mixed-Owner/Pinned-Action@v1` is pinned by the lockfile too, but written with the mixed-case | ||
| # owner/repo that authors commonly use (Azure, GoogleCloudPlatform, ...). | ||
| # Lockfile pins canonicalize owner/repo, so this ref is also expected to be suppressed (no | ||
| # finding). | ||
| - uses: Mixed-Owner/Pinned-Action@v1 | ||
| # Negative control: a mixed-case ref that is NOT recorded in the lockfile data must still be | ||
| # reported, guarding against over-suppression of every mixed-case ref. | ||
| - uses: Mixed-Owner/Unpinned-Action@v2 | ||
| # A repository-scoped pin also covers its sub-actions. | ||
| - uses: some-owner/pinned-action/save@v1 | ||
| # Ref casing must match the canonical lockfile pin exactly. | ||
| - uses: some-owner/pinned-action@V1 |
15 changes: 15 additions & 0 deletions
15
actions/ql/test/query-tests/Security/CWE-829/.github/workflows/self_ref_dollar.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| on: | ||
| pull_request | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build and test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # `$/` 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 isSelfRepository(nwo)` suppression, since | ||
| # without it `$/actions/foo@v1` would otherwise be reported as an unpinned tag. | ||
| - uses: $/actions/foo@v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
actions/ql/test/query-tests/Security/CWE-829/pinned_by_lockfile.model.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/actions-all | ||
| extensible: pinnedByLockfileDataModel | ||
| # Canonical lockfile pin rows supplied by an external model pack. | ||
| data: | ||
| - [".github/workflows/lockfile_pinned.yml", "some-owner/pinned-action", "v1"] | ||
| # Owner/repo is canonicalized; ref casing is preserved. | ||
| - [".github/workflows/lockfile_pinned.yml", "mixed-owner/pinned-action", "v1"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.