ci: run the confidential-material guard in CI, not just pre-commit - #413
Merged
Conversation
The pre-commit hook is per-clone and dies with --no-verify. Replacing the local checkout today left .git/hooks holding nothing but samples, so the guard had been inert. Add a --range mode to the same script and run it over the PR diff (and over direct pushes to main, which branch protection does not cover for admins), so one set of patterns is enforced in both places. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ased] Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Runs
scripts/check-no-confidential.shin CI, not just as a pre-commit hook.Why
The hook is the first line of defence against confidential material reaching this public repo, but it lives in one clone and dies with
--no-verify. CI is the backstop that is neither per-clone nor skippable.This branch was pushed but never had a PR opened, so the guard has been sitting unmerged — meaning
maincurrently has no CI-side protection at all. Found while auditing branch state.What it does
One
no-confidentialjob on every PR and every push tomain, sharing the exact same script as the hook so the patterns can't drift:fetch-depth: 0so the base is actually available).main— admins aren't covered by branch protection, so those commits get scanned too. Handles the two awkwardgithub.event.beforecases: all-zeros on a branch's first push, and a force-pushed-away commit, falling back to the parent when the SHA isn't resolvable.The script gains a
--range <base> <head>mode for this (CI has nothing staged), alongside the existing index-inspecting mode.Merge order
Worth landing before #412 — that PR adds 12 new files to the public repo and would benefit from the CI scan rather than relying on the hook alone.