Skip to content

chore(pre-commit): pin hooks to commit shas - #758

Open
aig-hannes wants to merge 2 commits into
mainfrom
chore/pin-pre-commit-hooks
Open

aig-hannes wants to merge 2 commits into
mainfrom
chore/pin-pre-commit-hooks

Conversation

@aig-hannes

Copy link
Copy Markdown
Contributor

What

Pins every hook rev: in .pre-commit-config.yaml to the commit SHA its tag points to today, with the tag as a comment:

rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c  # frozen: v6.0.0

This is the format pre-commit autoupdate --freeze writes. The hooks run the same code as before.

Why

Part of security days: every dependency must be pinned to a lockfile or a SHA. A tag can be moved to other code at any time, and a SHA cannot. Pre-commit hooks run on developer machines and in CI, so a moved tag would run new code there without review.

Renovate's pre-commit manager is not turned on in this repo yet. A change to the org Renovate config will turn it on for all repos. It then reads the # frozen: comment and updates the SHA and the version together, after the org's 14-day minimum release age. Until then, update by hand with pre-commit autoupdate --freeze.

The SHAs were resolved with git ls-remote from each hook repository.

🤖 Generated with Claude Code

Pin every hook rev to the commit its tag points to, with the tag in a '# frozen:' comment, the format 'pre-commit autoupdate --freeze' writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aig-hannes
aig-hannes requested a review from a team as a code owner October 30, 2026 15:34
@ox-security

ox-security Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

✔ No issues found

Branch chore/pin-pre-commit-hooks → main

View scan in OX Security →

detect-secrets reports the 40-character commit SHAs in .pre-commit-config.yaml as Hex High Entropy Strings. Add a baseline line filter for rev: lines that hold a bare SHA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 4 files with indirect coverage changes

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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