Skip to content

fix(ci): scope merge_group gitleaks scan to the merge-group commit range#337

Closed
scottschreckengaust wants to merge 1 commit into
mainfrom
fix/336-merge-group-gitleaks-range
Closed

fix(ci): scope merge_group gitleaks scan to the merge-group commit range#337
scottschreckengaust wants to merge 1 commit into
mainfrom
fix/336-merge-group-gitleaks-range

Conversation

@scottschreckengaust

Copy link
Copy Markdown
Contributor

Summary

Closes #336 (P0). Unblocks the merge queue (currently deadlocking PR #334).

On merge_group events, the Resolve PR commit range step in security-pr.yml set GITLEAKS_RANGE to empty, so the "range" scan fell back to the full reachable history (335 commits). The full history re-reports the historical #313 aws-account-id findings, so the required Secrets, deps, and workflow scan check fails for every PR entering the merge queue — see job 81132907683:

gitleaks git . --no-banner --redact --log-opts=""
INF 335 commits scanned.
WRN leaks found: 2
ERROR task failed

Fix

Add a dedicated merge_group case that scopes the scan to exactly the commits being merged, using the event payload (same source build.yml already uses):

range=${{ github.event.merge_group.base_sha }}..${{ github.event.merge_group.head_sha }}
  • pull_request behaviour unchanged (base.sha..head.sha)
  • workflow_dispatch keeps the full-history backstop (manual run, not a required check)

Verification

  • mise run security:gh-actions (zizmor): no findings
  • Draft → the real test is this PR's own merge-queue run; the pull_request run of security-pr on this PR exercises the unchanged path

Note

Pushed as a draft without waiting for the full local build, per maintainer direction — this is a CI-only YAML change and the queue is blocked.

…nge (#336)

The merge_group case of the range resolver set GITLEAKS_RANGE empty,
falling back to a full-history scan that re-reports the historical #313
aws-account-id findings and fails the required check for every PR in
the merge queue. Use the merge_group event's base_sha..head_sha so the
queue scans exactly the commits being merged, mirroring how build.yml
consumes the merge_group payload. workflow_dispatch keeps the
full-history backstop.

Closes #336
@krokoko

krokoko commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Fix merged, closing this one

@krokoko krokoko closed this Jun 12, 2026
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.

fix(ci): security-pr gitleaks scans full history on merge_group, deadlocking the merge queue

2 participants