Skip to content

Release v1.4.3: scan from the trunk of the remote, also when it is master - #28

Merged
RobHofmann merged 1 commit into
mainfrom
20-gitleaks-trunk-range
Nov 12, 2026
Merged

RobHofmann merged 1 commit into
mainfrom
20-gitleaks-trunk-range

Conversation

@RobHofmann

Copy link
Copy Markdown
Owner

Refs #20

v1.4.2 made the secret scan in the pre-push hook real on a network share. That showed a second bug: on a repository whose trunk is master, the scan read the whole history.

What changed

  • In a local run, Test-GitleaksBaseline.ps1 scans <trunk>..HEAD. The trunk is the first of origin/main, origin/master and origin/HEAD that exists. Before, only origin/main was tried, and without it the scan read every commit of every branch. On a share every blob is read over the network, so the pre-push hook ran for a very long time. Before v1.4.2, git refused the checkout and the scan read nothing, so nobody saw it.
  • The pull request and workflow ranges in GitHub Actions are unchanged.

How it was tested

  • New Pester cases: a remote with only master scans origin/master..HEAD; a remote with only origin/HEAD scans origin/HEAD..HEAD; with both main and master, main wins. All gate tests pass (34/34).
  • On a real consumer on a mapped network drive with master as its trunk, in a local checkout set up the way the hook does it: "Scanning the commits in origin/master..HEAD", 1 commit scanned, no leaks, 5 seconds. The same push under v1.4.2 was still scanning the full history after several minutes.
  • Pre-flight: gates, tests, story check and gitleaks pass.

Release steps after the merge: tag v1.4.3 with Release v1.4.3 for #20, publish the release.

@RobHofmann
RobHofmann merged commit ffc2405 into main Nov 12, 2026
16 checks passed
@RobHofmann
RobHofmann deleted the 20-gitleaks-trunk-range branch November 12, 2026 13:12
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