Repository navigation
Add an org-wide check for locked, exact action refs - #47
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 54ed6cf. Configure here.
| for u in uses: | ||
| if problem := ref_problem(u, entries, lock, allow_sha_pins): | ||
| problems.append(f"{rel}: {problem}") | ||
| return problems |
There was a problem hiding this comment.
Local composites outside .github/actions skipped
Medium Severity
repo_problems only opens composite files under .github/actions/**, while ref_problem treats every ./ uses: as local and returns immediately. A workflow can uses: ./some-action whose action.yml pins evil@main, and neither the Python check nor onboarding will see that remote ref.
Additional Locations (1)
Triggered by learned rule: Keep actions.lock; do not rewrite SHA pins
Reviewed by Cursor Bugbot for commit 54ed6cf. Configure here.


Adds
actions-lock-check.yml, a reusable workflow any repo can call on pull requests to enforce the workflow-pinning convention: step-level actions use an exactvX.Y.Zrelease (or a full SHA only when the commit has no release tag), andactions.lockpins them.What it checks
gh actions-lock --verify-localpasses (offline: every ref has a lockfile entry). Online--verifyfails on runners because theaquasecurityorg has an IP allow list that rejects runner IPs; the runner already rejects a locked commit that isn't reachable from its tag.scripts/action_pins.py(now also a CLI) walks every workflow and in-repo composite action:$/,./ordocker://. Floating tags (@v4,@v4.4) and branches fail.allow-sha-pins: true(for generator-owned SDK workflows).actions.lockwith an entry for that exact ref.jobs.<id>.uses) aren't covered by lockfiles and are skipped.The job references no secrets and only has
contents: read, becausegh-actions-lockis a binary pinned by release tag.Other changes
lock_problemkeeps its behaviour for the existing tests; the shared logic moved intoref_problem.semgrep.ymlpinnedllm-credentials@maintoaf49085, the commitactions.lockalready ran. The lockfile was regenerated from scratch, so the only lock change for existing workflows is that key moving from@mainto the SHA (same commit). README examples point at a commit SHA instead of@main.actions-lock-check-self-test.ymlruns the unit tests and calls the check on this repo. In this repo the check uses the PR's copy ofaction_pins.py; callers fetch it frommain.Tested
python -m unittest discover -s scripts -p 'test_*.py': 131 pass, including newtest_action_pins.py(accepted forms, floating/branch/unlocked/tagged-SHA rejections,allow-sha-pins, onboarding, composite actions).python3 -I scripts/action_pins.py .passes on this repo. Before the fix, running plaingh actions-lockhere rewrote the untaggedtrivy-actionSHA to@master, and the check flagged both lines.Turning it on org-wide needs either a caller workflow per repo or an org ruleset that requires this workflow.