Skip to content

ci: gitleaks fails unrelated PRs on fixtures from other branches #236

Closed

Description

@ElbertePlinio

Problem

The gitleaks CI job checks out with fetch-depth: 0 and scans with no log options, so it scans the history of every branch on the remote. Fixture allowlists live in .gitleaks.toml on each branch. A branch that adds a fixture and its allowlist entry passes its own PR, but every other PR scans that branch with main's config and fails until the first PR merges.

Where it was found

PR #235 (#200) failed gitleaks at 773a740 with 12 findings. All of them are the RFC 6455 sample Sec-WebSocket-Key in test/security/security-viewer-bridge.test.ts on feat/207-pip-viewer (PR #225). PR #225 allowlists that value in its own .gitleaks.toml and passes. A scan of #235's own commits finds no leaks.

Acceptance criteria

  • A PR's gitleaks result depends only on the commits that PR would merge and on its own config.
  • Pushes to main still scan the full history of main.
  • The existing exact-value allowlist policy is unchanged.

Checklist

  • Scope the PR scan to the merge commit's history, for example with --log-opts on the checked-out ref, instead of every remote branch
  • Keep a full-history scan on main
  • Confirm with a branch that adds an allowlisted fixture while another PR is open

Refs #200, #207.

Activity

  1. added
    bug
    on Oct 3, 2026
  2. ElbertePlinio commented on Oct 3, 2026

    @ElbertePlinio
    MemberAuthor

    This also blocks #237. Its own commits are clean (gitleaks over origin/main..HEAD: no leaks), but the full-history scan reports 12 generic-api-key findings in test/security/security-viewer-bridge.test.ts on origin/feat/207-pip-viewer (commits 6afd5ad and 33bfaed). That branch's own .gitleaks.toml allowlists the RFC 6455 sample key, while main's does not yet, so every other PR fails until #225 merges or this issue is fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions