Skip to content

fix(trufflehog): scope merge_group scans to diff like pull_request#141

Merged
isaiah-grafana merged 4 commits intomainfrom
fix/trufflehog-merge-group-diff-scan
Mar 30, 2026
Merged

fix(trufflehog): scope merge_group scans to diff like pull_request#141
isaiah-grafana merged 4 commits intomainfrom
fix/trufflehog-merge-group-diff-scan

Conversation

@isaiah-grafana
Copy link
Copy Markdown
Contributor

Merge queue runs use github.event_name merge_group, which previously fell through to trufflehog filesystem . and scanned the entire repo. Fetch merge_group base/head SHAs and git diff --name-only to match PR behavior.

Merge queue runs use github.event_name merge_group, which previously fell
through to trufflehog filesystem . and scanned the entire repo. Fetch
merge_group base/head SHAs and git diff --name-only to match PR behavior.

Made-with: Cursor
@isaiah-grafana isaiah-grafana requested a review from a team as a code owner March 30, 2026 14:52
@github-actions

This comment has been minimized.

…shell)

Zizmor flags `${{ }}` inside run: scripts as code injection via template
expansion. Use step env for PR and merge_group SHAs and reference them as
quoted shell variables.

Made-with: Cursor
… checks

Rulesets run the workflow from the PR; point uses: at this branch so
TruffleHog exercises reusable-trufflehog from the same ref. Revert to
@main when merging.

Made-with: Cursor
fi
else
# Push to main: Scan current filesystem
# push to main (and any other events): full filesystem scan
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what context do we expect a push to main or other events that would trigger a full filesystem scan?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. In practice that path is almost always push to main from the org workflow. There’s no PR/merge-group payload on that event, so it hits the else and does a full scan. The “other events” line is just a generic fallback if this reusable ever gets called another way; we don’t rely on anything else today.

Copy link
Copy Markdown
Contributor

@ezebunandu ezebunandu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Looks one branch of the logic will still trigger a full filesystem scan. Is that assuming that somehow, we can push directly to main without opening a PR?

@isaiah-grafana isaiah-grafana merged commit a7ed27a into main Mar 30, 2026
13 checks passed
@isaiah-grafana isaiah-grafana deleted the fix/trufflehog-merge-group-diff-scan branch March 30, 2026 15:38
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.

3 participants