Skip to content

ci: add a gitleaks workflow that scans the commits of each PR - #1

Closed
tabedzki wants to merge 4 commits into
gh-pagesfrom
tabedzki/ci/gitleaks-pr-scan
Closed

tabedzki wants to merge 4 commits into
gh-pagesfrom
tabedzki/ci/gitleaks-pr-scan

Conversation

@tabedzki

@tabedzki tabedzki commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Problem

This repo has no secret scanning in CI.

What changed

Adds a gitleaks workflow (and .github/scripts/gitleaks-changes.sh, the same script used in U19-pipeline-python). On a pull request or push it scans every commit since the base, plus the lines each merge commit introduced itself, so a secret typed in while resolving a conflict is caught too. It does not rescan old history on every run. There is no manual-run trigger: a run without a base to scan from could not check anything.

  • The gitleaks binary is pinned to 8.30.1 and its sha256 is verified before use (a wrong checksum fails the job).
  • Actions are SHA-pinned, permissions: contents: read, persist-credentials: false; zizmor reports no findings.
  • The gitleaks job is not a required check (no ruleset on this repo).

Testing

The script was run against a scratch repo: a PR range with a token committed in an earlier commit fails (1 github-pat finding); an unchanged range, an all-zeros base and a clean range pass; an empty base fails. The install step was run with the real and a wrong checksum.

Assisted-by: ClaudeCode:claude-sonnet-5-5

github-actions Bot and others added 4 commits October 6, 2026 00:10
Add a gitleaks workflow. On a PR (or push) it scans every commit since the
base, plus the lines merge commits introduced themselves, via
.github/scripts/gitleaks-changes.sh. A manual run (workflow_dispatch)
scans the whole history. The gitleaks binary is pinned to 8.30.1 and its
sha256 is checked before it is used.

Assisted-by: ClaudeCode:claude-sonnet-5-5
A manual run has no base to scan from. Drop workflow_dispatch from the
standalone gitleaks workflows and skip the gitleaks step on a manual run of
the lint workflow. Make the script fail on an empty GITLEAKS_BASE instead of
falling back to a full-history scan, so a missing base can never pass
silently.

Assisted-by: ClaudeCode:claude-sonnet-5-5
Do not fall back to a full-history scan, so a missing base can never pass
silently.

Assisted-by: ClaudeCode:claude-sonnet-5-5
@tabedzki

Copy link
Copy Markdown
Contributor Author

🤖 AI text below 🤖

Closed without merging, and it cannot be reopened.

This repo only holds the built site. Its default branch, gh-pages, is rewritten on every docs deploy: deploy.yml in BrainCOGS/VRrigs-documentation publishes .vitepress/dist here with crazy-max/ghaction-github-pages, which leaves a single parentless commit. This PR branch has no history in common with that commit, so GitHub will not reopen it. A workflow merged here would also be deleted by the next deploy.

The sources are scanned for secrets in VRrigs-documentation (BrainCOGS/VRrigs-documentation#49), so only built HTML reaches this repo. If scanning of the published output is wanted, add the step to the deploy job there, before the publish step.

The branch tabedzki/ci/gitleaks-pr-scan is left in place and can be deleted.

@tabedzki
tabedzki deleted the tabedzki/ci/gitleaks-pr-scan branch October 16, 2026 19:55
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