ci: guard pr-notify against Dependabot runs explicitly - #744
Conversation
Dependabot-triggered runs resolve secrets against a separate, repository-scoped store that GCHAT_PRS_WEBHOOK is not in, so the notifier would fail with "Input required and not supplied: webhookUrl". That does not happen today, but only incidentally: pr-notify needs security-checks, the shared security-checks workflow already guards on this same condition, and a skipped dependency skips this job. Adding always() to pr-notify, or dropping security-checks from its needs, would silently turn every Dependabot PR red. github.actor is what determines which secrets store a run reads from, so a human pushing to a Dependabot branch is unaffected. No behaviour change - this makes the existing protection intentional and local. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview That documents locally why Dependabot PRs should not hit the GChat notifier: Dependabot runs use a different secrets scope, so Reviewed by Cursor Bugbot for commit c8fe400. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
…746) * ci: remove hardcoded secrets check from PR workflow Trunk already runs trufflehog at the PR level (trufflehog@3.90.6 in .trunk/trunk.yaml), alongside a custom mparticle-api-key-check rule, so this job was duplicating secret scanning that Trunk Check already covers. The job was also intermittently red -- 3 failures in 70 recent runs, always in ~5s. It failed on #742 while passing on #743 and #744 with identical config. The cause is in the reusable workflow, which resolves and downloads "latest" trufflehog at runtime by curling the GitHub releases API and grepping the response; that step breaks when the API rate-limits. Trunk pins its trufflehog version and has no runtime download, so it does not share this failure mode. Nothing in the workflow depends on the removed job; no other job referenced it via needs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * ci: enable trufflehog-git to scan the commits a PR adds The already-enabled trufflehog linter runs `trufflehog filesystem` against changed files in the working tree, so it cannot see a secret that was committed and then removed in a later commit on the same branch -- the file no longer exists to scan. trufflehog-git closes that gap. It runs `trufflehog git --since-commit ${upstream-ref}`, walking only the commits the PR adds, so it stays fast (~1.7s) and does not resurface historical findings. Demonstrated with a private key committed then removed on a branch: filesystem scan -> missed it (only the pre-existing daily.yml FP) git-history scan -> PrivateKey <- probe-key.pem @ f48c6617 Both linters keep Trunk's default --only-verified, so this widens scan scope, not the reporting threshold. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>



Background
Dependabot-triggered runs resolve
secretsagainst a separate, repository-scoped store thatGCHAT_PRS_WEBHOOKis not in, so on a Dependabot rungchat_webhookarrives blank and the notifier fails withInput required and not supplied: webhookUrl.That does not happen today — but only incidentally.
pr-notifyneedssecurity-checks; the sharedsecurity-checksworkflow already guards on this same condition, so it skips on Dependabot PRs; and becausepr-notifyhas noalways(), a skipped dependency skips it too. Verified as skipping rather than failing on #722, #720 and #705.Nothing local to this repo expresses that constraint, so two ordinary edits would silently turn every Dependabot PR red: adding
always()topr-notify(a reasonable-looking change, used elsewhere to keep a notifier alive when an upstream job is skipped by a path filter), or droppingsecurity-checksfrom itsneedswhile reshuffling required checks.What changed
pull-request.yml— addedgithub.actor != 'dependabot[bot]'to thepr-notifyjob'sif.github.actoris what GitHub uses to decide which secrets store a run reads from, so the guard matches the exact circumstance under which the webhook is unavailable. A human pushing to a Dependabot branch still gets the notification.Validation
actionlintandtrunk checkclean. No behaviour change:pr-notifyalready skipped on Dependabot PRs and still does; it already ran on human PRs and still does. This only makes the existing protection intentional and local rather than a side effect of theneedsgraph.Being human-authored, this PR exercises the happy path —
Notify GChatrunning and succeeding here is the regression signal.