Repository navigation
chore(pre-commit): pin hooks to commit shas - #758
Open
aig-hannes wants to merge 2 commits into
Open
aig-hannes wants to merge 2 commits into
aig-hannes wants to merge 2 commits into
Conversation
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>
|
OX Security reviewed this pull request — nothing to fix.
Branch |
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 Report✅ All modified and coverable lines are covered by tests. |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Pins every hook
rev:in.pre-commit-config.yamlto the commit SHA its tag points to today, with the tag as a comment:This is the format
pre-commit autoupdate --freezewrites. 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-commitmanager 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 withpre-commit autoupdate --freeze.The SHAs were resolved with
git ls-remotefrom each hook repository.🤖 Generated with Claude Code