Skip to content

ci: pin GitHub Actions by commit SHA and refresh msal-node and basic-ftp past advisories - #831

Merged
JuroOravec merged 3 commits into
mainfrom
ci/pin-actions-and-bump-tooling
Nov 21, 2026
Merged

JuroOravec merged 3 commits into
mainfrom
ci/pin-actions-and-bump-tooling

Conversation

@JuroOravec

@JuroOravec JuroOravec commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

(Opus 5.5)

What changed and why

1. Every GitHub Action is pinned to a full commit SHA. A tag such as actions/checkout@v7 can be moved, or rewritten by whoever controls the action's repository, and the next run would execute that code with this repository's tokens and secrets. A commit SHA always names the same code.

  • 278 tag-referenced uses: lines across 30 files under .github/ (workflows and the composite action citry-core-wheel) now read owner/repo@<sha> # <tag>. Each tag was resolved today with gh api repos/<owner>/<repo>/git/ref/tags/<tag>, following annotated tags to their commit.
  • Actions pinned: actions/checkout v7, setup-python v7, upload-artifact v7, download-artifact v8, setup-node v7, cache (incl. restore/save) v6, attest-build-provenance v4, upload-pages-artifact v5, deploy-pages v5, setup-java v6, github/codeql-action (init/analyze) v4, Swatinem/rust-cache v2, taiki-e/install-action v2, lycheeverse/lychee-action v2, pnpm/action-setup, actions/create-github-app-token.
  • One SHA per action. For pnpm/action-setup (8 tag lines) and create-github-app-token (1 tag line), today's v6/v3 tags point at v6.1.1 and v3.4.0 (released 2026-11-18), while the release workflows already pinned reviewed commits for v6.1.0 and v3.2.0. The tag lines reuse those reviewed SHAs rather than moving release jobs to new code, and their comments now name the exact version (# v6.1.0, # v3.2.0). Dependabot will propose the newer versions as an ordinary update.
  • The new workflow_action_pins validator fails the gate on a uses: value that names a tag or branch, or a SHA pin without its # <tag> comment. It walks the parsed YAML, so flow mappings, quoted keys and wrapped values are covered; local ./ actions and docker:// images are skipped. Cost: it parses about 35 YAML files in milliseconds inside the existing validator phase of scripts/check.py, with no new CI job, and it protects the one contract that matters here, that no workflow runs code a tag move could change. Two tests that compared uses: with an exact @v7/@v6 string now match the action name.
  • Docs: a "Pinning GitHub Actions" section in docs/codebase.md and a bullet in CLAUDE.md code conventions.

2. @azure/msal-node 6.0.1 -> 7.2.3 (GHSA-xcx6-jx8p-x3h5). @vscode/vsce 4.1.0 declares @azure/identity ^4.13.2, and @azure/identity 4.14.1 declares @azure/msal-node ^7.1.0, so a lockfile refresh within the declared ranges fixes it. No override or vsce bump is needed.

3. basic-ftp 5.3.1 -> 6.2.6 (GHSA-c475-qrg2-pj4r, GHSA-5pm8-86m8-9m6r, GHSA-r4jh-29pc-gfqr). @lhci/cli 0.16.1 declares proxy-agent ^8.0.2; proxy-agent 8.0.3 pins pac-proxy-agent 9.1.1, which pins get-uri 8.0.2, which declares basic-ftp ^6.2.4. Again a refresh within ranges, no override.

Lockfile entries that moved, all inside those two chains: @azure/identity 4.14.0 -> 4.14.1, @azure/msal-common 16.14.1 -> 16.17.0, semver 7.8.6 -> 7.8.5 under jsonwebtoken (deduplicated, still within ^7.5.4), proxy-agent 8.0.2 -> 8.0.3, pac-proxy-agent 9.1.0 -> 9.1.1, get-uri 8.0.1 -> 8.0.2, pac-resolver 9.0.1 -> 9.0.2, degenerator 7.0.1 -> 7.0.2, netmask 2.1.1 -> 2.1.2, quickjs-wasi 2.2.0 -> 3.7.0 (required by the new pac-resolver), and the proxy-agent peer suffix on @lhci/utils, lighthouse, puppeteer-core and @puppeteer/browsers.

How Dependabot keeps the pins current

Dependabot's github-actions entry reads the trailing # <tag> comment and opens a pull request that moves the SHA and the comment together. The entry now uses directories: ["/", "/.github/actions/*"], because / alone does not reach composite actions under .github/actions/. Two cases still need a manual step, both documented: scripts/validators/toolchain.py names the SHAs of seven actions (maturin, rust-toolchain, PyPI publish, setup-uv, sccache, rust-cache, pnpm setup), so a Dependabot pull request that moves one of them must update that constant too; and dtolnay/rust-toolchain carries a date comment, not a tag. Worth watching on the first monthly run: whether the github-actions group opens one pull request across both directories or one per directory.

Not in scope: the example projects' own workflows (examples/*/*/.github/workflows/check.yml) still use actions/checkout@v7. Users copy those into their repositories, Dependabot does not scan them here, and the validator skips them; the docs say so.

Checks run

  • actionlint: same 5 pre-existing shellcheck style notes before and after, nothing new.
  • All workflow and action YAML parses; validators workflow_action_pins, workflow_run_expressions, release_caches, release_security, toolchain and dependabot pass.
  • pytest on test_workflow_action_pins_validator.py, test_ci_workflows.py, test_release_dependency_wheels.py, test_release_caches_validator.py: 68 passed. ruff, ruff format and mypy clean on the new files.
  • pnpm install --lockfile-only is a no-op on the committed lockfile.
  • pnpm audit (dev and prod): before, the three basic-ftp advisories and GHSA-xcx6-jx8p-x3h5 were reported; after, none of them. One unrelated high remains in the dev audit (GHSA-g84c-rxfj-3j2c, webpack-dev-middleware via Storybook). pnpm audit --prod reports only the already-ignored minimatch advisory, before and after.
  • An independent reviewer checked all 16 SHAs against gh api, tried to bypass the validator, and reviewed the prose; its findings are folded in.

Versioning

CI configuration, a repository validator, tests, contributor docs and the dev-tooling lockfile only. Nothing the 1.x promise covers changes, no contract version is involved, and no changelog entry is needed.

🤖 Generated with Claude Code

https://claude.ai/code/session_017pjjQdqk1kqBV42Y1fCNcx

JuroOravec and others added 2 commits November 21, 2026 17:33
Pin the 278 tag-referenced `uses:` lines under .github/ to the commit
their tag points at, with the tag in a trailing comment. Lines for
pnpm/action-setup and create-github-app-token reuse the SHAs already
pinned and reviewed elsewhere (v6.1.0, v3.2.0), so each action has one
SHA. Dependabot now also scans .github/actions/*, and the new
workflow_action_pins validator rejects a tag or branch reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017pjjQdqk1kqBV42Y1fCNcx
Refresh the lockfile within the declared ranges: @azure/identity 4.14.1
brings @azure/msal-node 7.2.3 (GHSA-xcx6-jx8p-x3h5), and proxy-agent
8.0.3 brings get-uri 8.0.2 and basic-ftp 6.2.6 (GHSA-c475-qrg2-pj4r,
GHSA-5pm8-86m8-9m6r, GHSA-r4jh-29pc-gfqr). No override is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017pjjQdqk1kqBV42Y1fCNcx
@JuroOravec
JuroOravec merged commit 18e7ae7 into main Nov 21, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant