Skip to content

Pin CI actions to SHAs and let Dependabot keep them current - #101

Merged
CrypticSwarm merged 3 commits into
masterfrom
pin-action-shas
Nov 15, 2026
Merged

CrypticSwarm merged 3 commits into
masterfrom
pin-action-shas

Conversation

@CrypticSwarm

Copy link
Copy Markdown
Owner

Moving actions from floating tags to full commit SHAs means a moved or hijacked tag can no longer change what CI runs. Each pin keeps the release tag in a trailing comment (# v7.0.1), which is the format Dependabot reads and updates.

  • Bumps actions/setup-node v4 → v7.1.0 and actions/checkout v4 → v7.0.1. None of the breaking changes from v5 to v7 apply here: we set cache: npm explicitly, don't use NODE_AUTH_TOKEN, and don't use pull_request_target.
  • Adds .github/dependabot.yml with weekly updates for github-actions and the docker-broker's npm deps. A 14-day cooldown means Dependabot only proposes a release once it is two weeks old. Major @types/node bumps are ignored so the types stay on the Node major the broker runs.
  • Makes the workflow token read-only (contents: read).
  • Documents the pinning convention in docs/development/testing.md.

Not covered: the Docker base images still use floating tags.

A moved or compromised tag would otherwise change what CI runs without a
diff here. The trailing version comment keeps the pins readable and lets
Dependabot bump them. Also moves setup-node v4 -> v7.1.0 and checkout
v4 -> v7.0.1.
Without a config Dependabot only opens security PRs, so the SHA pins
would go stale. The cooldown keeps a fresh, possibly compromised release
from being proposed until it has had two weeks in the wild.
Nothing in CI writes to the repo, so a compromised action or npm install
script should not inherit the repo's default token scopes.
@CrypticSwarm
CrypticSwarm merged commit 419b930 into master Nov 15, 2026
4 checks passed
@CrypticSwarm
CrypticSwarm deleted the pin-action-shas branch November 15, 2026 20:28
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