Skip to content

gitleaks: scan HEAD's history only - #20

Merged
Soul-Craft merged 1 commit into
mainfrom
ci/gitleaks-head-only
Oct 17, 2026
Merged

Soul-Craft merged 1 commit into
mainfrom
ci/gitleaks-head-only

Conversation

@Soul-Craft

Copy link
Copy Markdown
Contributor

Bug: actions/checkout with fetch-depth: 0 fetches every branch, and gitleaks git scans --all by default. So a finding on one open PR's branch fails gitleaks on every other PR in that repo. Right now site#65's commit bf417f4 fails site#67, which never contains it.

Fix: --log-opts=HEAD. It still scans the entire history of the checked-out commit (on a PR, the merge preview: main plus the PR's commits), so nothing that could land goes unscanned. Other branches are no longer scanned.

🤖 Generated with Claude Code

The full-depth checkout fetches all branches, and gitleaks git defaults to --all, so a
finding on one open PR's branch (site bf417f4) failed every other site PR. --log-opts=HEAD
keeps the whole history of what would land (on a PR, the merge preview) and nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Soul-Craft
Soul-Craft requested a review from a team as a code owner October 17, 2026 22:04
@Soul-Craft
Soul-Craft merged commit 0c3e670 into main Oct 17, 2026
3 checks passed
@Soul-Craft
Soul-Craft deleted the ci/gitleaks-head-only branch October 17, 2026 22:05
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