Skip to content

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

Merged
aig-hannes merged 2 commits into
mainfrom
chore/pin-pre-commit-hooks
Nov 2, 2026
Merged

aig-hannes merged 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 reads the # frozen: comment and updates the SHA and the version together, after the org's 14-day minimum release age. To update by hand, run pre-commit autoupdate --freeze.

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

🤖 Generated with Claude Code

@aig-hannes
aig-hannes requested a review from a team as a code owner October 30, 2026 10:22
@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 →

@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.

albermax
albermax previously approved these changes Oct 30, 2026
aig-hannes and others added 2 commits November 2, 2026 13:53
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. Renovate's pre-commit manager updates SHA and comment together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
@aig-hannes
aig-hannes force-pushed the chore/pin-pre-commit-hooks branch from 724835d to cf80701 Compare November 2, 2026 12:53
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@aig-hannes
aig-hannes merged commit 3791cca into main Nov 2, 2026
12 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.

3 participants