Skip to content

fix(zizmor): support pull_request events in auto-delete job#1975

Merged
zerok merged 1 commit into
grafana:mainfrom
svennergr:fix/auto-delete-pr-events
May 28, 2026
Merged

fix(zizmor): support pull_request events in auto-delete job#1975
zerok merged 1 commit into
grafana:mainfrom
svennergr:fix/auto-delete-pr-events

Conversation

@svennergr
Copy link
Copy Markdown
Contributor

Summary

  • Org-required workflows deployed via rulesets only fire pull_request events, not push. The auto-delete job was skipped in those repos because it required github.event_name == 'push'.
  • Extend the condition to also accept pull_request events, and resolve the correct branch ref (github.head_ref) and actor (github.event.pull_request.user.login) for PR events.

Test plan

  • Trigger auto-delete via a push event to a non-default branch with a dangerous-triggers finding (existing behavior).
  • Trigger auto-delete via a pull_request event from an org-required workflow ruleset with a dangerous-triggers finding.
  • Verify Slack notification shows the correct branch name and actor in both cases.

Org-required workflows via rulesets only fire pull_request events,
not push. Extend the delete-vulnerable-branch job to handle both,
using the correct ref and actor for each event type.
@svennergr svennergr requested a review from a team as a code owner May 28, 2026 14:40
@zerok zerok added this pull request to the merge queue May 28, 2026
Merged via the queue into grafana:main with commit 648a1ae May 28, 2026
19 checks passed
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.

2 participants