Repository navigation
✨ Adds support for Actions lock files to detect pinning - #5247
Open
jessehouwing wants to merge 11 commits into
Open
jessehouwing wants to merge 11 commits into
jessehouwing wants to merge 11 commits into
Conversation
jessehouwing
requested review from
justaugustus and
spencerschrock
and removed request for
a team
September 22, 2026 19:05
jessehouwing
force-pushed
the
main
branch
2 times, most recently
from
September 24, 2026 11:31
02d9f49 to
f4957c7
Compare
- Detect actions pinned via github/gh-actions-lock lockfiles (.github/workflows/actions.lock) - Treat \\$/...\ self-repository references as inherently pinned - Fix filepath.Dir/Clean usage on repo-relative (forward-slash) paths in IsWorkflowFile, fileIsInVendorDir, and shell_download_validate - Fix clients/localdir trimPrefix to correctly normalize paths to forward slashes on Windows, fixing --local scans - Add .gitattributes to clients/localdir/testdata to prevent CRLF corruption of binary-compared fixtures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Author
|
@JamieMagee you might be interested in this one as well then |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Bump github/actions-lockfile to v0.0.6, which reads schema v0.0.1-v0.0.3, and add tests for v0.0.3 (github.com and home-host pins), v0.0.2 and unsupported future versions. Lockfile pins are treated as authoritative regardless of hostname, so no lookup (and no credential use) against any host happens for them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Schema versions newer than the library supports are read best-effort (workflow pin keys only) and a warning is logged, instead of ignoring the lockfile. Malformed lockfiles are ignored with a warning too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
A workflow pin only counts as pinned when its dependency entry exists in the lockfile and resolves to a well-formed sha1/sha256 commit. This is an offline integrity check; no network lookups are made. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
Restore the checked yaml.Unmarshal error (errcheck check-blank) and make the ListFiles mock honor its predicate so non-lockfile fixtures are not parsed as actions.lock. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jesse Houwing <jesse.houwing@gmail.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What kind of change does this PR introduce?
Feature: detect pinning via GitHub Actions lock files.
What is the current behavior?
scorecard only detects pinned actions using
@sha, but ignores the new actions lock files, flooding my security tab with 100's of unpinned actions warnings.What is the new behavior (if this is a feature change)?
Reads
.github/workflows/actions.lockif present and treats auses:reference recorded for that workflow as pinned.github/actions-lockfilev0.0.6, which reads lockfile schemas v0.0.1 through v0.0.3. v0.0.3 adds a per-dependencyhostname(empty = the home host, e.g. the GHE.com tenant;github.com= a github.com-bound pin on a GHE.com instance).hostname: matching is done on theOWNER/REPO@REFpin key from the lockfile and makes no network call to any host. A pin that belongs to a GHE.com tenant is never looked up on public github.com, and no enterprise credentials are ever sent anywhere by this code path.dependenciesentry exists with a recorded commit (offline check; no network lookups).Which issue(s) this PR fixes
NONE
Special notes for your reviewer
Generated with copilot, tested against all my own repos on Windows (which required additional fixes to make it work on Windows).
Windows-only test failures seen locally (file handle leaks,
pathvsfilepath, CRLF fixtures) are addressed in #5342, and thepkg/scorecardrate-limit stall is addressed in #5343; they can be ignored here. The path fixes in this PR overlap with #5342 and will merge cleanly.Relationship to #5248 (immutable release pinning): that PR performs release lookups; any lookup there must skip pins that are covered by a lockfile entry (in particular GHE.com home-host pins), so enterprise tokens are never sent to github.com.
Tested on Ubuntu-latest using CI.
Does this PR introduce a user-facing change?