Skip to content

Stop the secret scan failing on commit counts that end in zero - #5

Merged
kwsantiago merged 2 commits into
masterfrom
fix-secret-scan-count
Oct 21, 2026
Merged

kwsantiago merged 2 commits into
masterfrom
fix-secret-scan-count

Conversation

@kwsantiago

@kwsantiago kwsantiago commented Oct 20, 2026 •

Copy link
Copy Markdown

The secret-scan coverage check matched the substring 0 commits scanned, so any commit count ending in zero (10, 1600 and so on) failed the job even when the scan ran and found nothing.

It now requires exactly one commit count in the log and fails unless that count is provably above zero. A zero, missing, repeated or non-numeric count all fail closed; the inverted test also fails when the value cannot be read as an integer, where the earlier form passed. A [git] error line and a real leak fail as before. The extraction ends in || true, so the step still reaches its error message if the job's shell ever gains pipefail.

Tested by running the step from this workflow file under bash -e, and again with pipefail, against a stub for each case: counts of 1, 10, 1599 and 1600 with no leaks pass; zero commits, a missing count, no output, git stderr with a nonzero count, a found leak, an oversized count, and a zero followed by a later count all fail. Run for real against this repository, gitleaks scanned 1602 commits, found no leaks, and the step passed.

@kwsantiago
kwsantiago merged commit 3684b06 into master Oct 21, 2026
8 checks passed
@kwsantiago
kwsantiago deleted the fix-secret-scan-count branch October 21, 2026 00:18
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