Conversation
Adds the secret-scan command from the Git Hooks RFC (discussion bcgov#23) to the lefthook config already on main (lint + typecheck only, no secret scanning yet). Matches the pattern now live on bcgov/bcregistry and bcgov/ppr: bare 'npx gitleaks-secret-scanner', no custom install script. Also guards 'prepare' with '|| exit 0' so a missing git binary (e.g. a git-less CD build image) can't fail the install - this bit bcregistry after it merged the same lefthook setup without the guard: bcgov/bcregistry#281
panish16
requested review from
bolyachevets,
pwei1018 and
thorwolpert
as code owners
September 23, 2026 17:12
Collaborator
|
This isn't needed as it will get covered with the 2 branches being merged to main. |
Author
|
Ill close this one then |
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.
Part of the Git Hooks RFC rollout (bcgov/entity#34619, discussion #23).
mainalready has lefthook (lint + typecheck) but no secret scanning. This adds it, matching the pattern now live on bcgov/bcregistry#281 and bcgov/ppr#2364: barenpx gitleaks-secret-scannerin the pre-commit config, no custom install script.Also guards
preparewith|| exit 0. This repo has no CI/CD workflows right now, so it's not an active problem here, but it's the exact bug that broke bcregistry's CD after merging the same base lefthook setup without the guard (bcgov/bcregistry#281) - worth having from the start rather than rediscovering it later once this repo does get a pipeline.Note (not fixed here, out of scope):
pnpm installprints[WARN] The "pnpm" field in package.json is no longer read by pnpm ... "pnpm.onlyBuiltDependencies". That's pre-existing and unrelated to this change -lefthookstill builds and installs fine despite the warning (verified with both a normal install andCI=true pnpm install --frozen-lockfile), so it's not currently breaking anything, but the config format itself is stale for whatever pnpm version is in use now.Verified with a real
git commit, not just a dry run: the hook installs, and committing a fake GitHub token is correctly caught and blocked (RuleID: github-pat) before the commit is created.Did not touch
feature-design-01- it's 7 commits behindmainand bundles an unrelateddesign/Nuxt site, so it's not a clean base to build this on top of.