Skip to content

ci: scan only the PR's own commits for secrets #7

Closed

Description

@Bugs5382

What and why

The gitleaks step in every repo's PR checks fails pull requests over commits that are not in them. actions/checkout with fetch-depth: 0 fetches every branch, and gitleaks detect with no --log-opts runs git log --full-history --all, so each PR run scans every branch in the repo. A finding on one branch fails every other open PR.

Two findings on in-flight branches currently fail every PR:

  • cryptos: commit 37897e3 on feat/284-protocol-switches (internal/config/protocols_test.go:30)
  • docs: commit 073a3c8 on docs/20-reference-pages (docs/reference/root-cert-profile.md:21)

Scope

  • PR runs: scan only the PR's own commits, base.sha..head.sha from the pull_request event (--log-opts).
  • cryptos push runs: its separate Gitleaks workflow also runs on every push. A push to main keeps a full-history scan, but of main only (it holds only merged commits), not --all. A push to any other branch scans that branch's commits not yet on main.
  • docs, api, manager, web and helm have no push-time scan, so only the PR step changes there.
  • gitleaks stays the pinned 8.30.0 binary. Nothing else in the workflows changes.

One PR per repo (cryptos, docs, api, manager, web, helm), each saying Refs CryptOS-PKI/.github#<this issue>.

Done when

  • The six PRs are merged.
  • A clean PR passes the scan, and a secret added in a PR's own commit still fails it (shown in each PR).

Activity

  1. added this to the v1.0.0 milestone on Sep 30, 2026
  2. self-assigned this
    on Sep 30, 2026
  3. added theissue type on Sep 30, 2026
  4. Bugs5382 commented on Sep 30, 2026

    @Bugs5382
    ContributorAuthor

    PRs, one per repo, all green and ready: CryptOS-PKI/cryptos-node#290, CryptOS-PKI/docs#42, CryptOS-PKI/api#125, CryptOS-PKI/cryptos-manager#131, CryptOS-PKI/cryptos-web#133, CryptOS-PKI/helm#25. Merge CryptOS-PKI/docs#42 before CryptOS-PKI/docs#36: #36 fails the old full-history scan and #42 fails the old PR Body check, so #42 carries a same-repo Refs #36 line until #36 lands. After #42 merges, #36 needs a fresh run (a body edit or push) to pick up the scoped scan.

  5. Bugs5382 commented on Sep 30, 2026

    @Bugs5382
    ContributorAuthor

    Done: every PR under this issue is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

skip-changelogExcluded from release notes (chore/ci/test/style).

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions