Skip to content

lint: gitleaks range scan skips merge-commit diffs #13

Closed

Description

@kleinbem

CodeRabbit flagged this on the fleet-lint rollout PRs (kleinbem-dev/cadre#11, kleinbem-dev/nix-gantry#16, kleinbem-dev/coderabbit#8).

lint/run.sh runs gitleaks git --log-opts="${LINT_BASE}..${LINT_HEAD}". With --log-opts set, gitleaks runs git log -p -U0 <opts>, and git log -p prints no diff for merge commits by default. So a secret that only appears in a merge commit's conflict resolution on a PR branch (e.g. after a merge-style gh pr update-branch) isn't scanned in range mode. Tree mode (no base) isn't affected.

Possible fix: add --diff-merges=remerge (git ≥ 2.36; shows only what the merge itself changed beyond the automatic merge) or -m (diff against every parent, noisier) to the log opts, then release v1.3.1 and bump the pins.

🤖 Generated with Claude Code

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions