Navigation Menu

Skip to content

Why do I get a "push" event instead of a "pull_request" on a PR merge to master #26558

Answered by melink14
Grraahaam asked this question in Actions
Discussion options

You must be logged in to vote

Just commenting briefly to say what you’re experiencing is expected. pull_request event triggers when a PR event occurs targeting the branches specified in the workflow. push event is triggered whenever a commit is pushed to the specified branches.

Since a PR merge is just a commit pushed to the target branch it will trigger push events as you’ve seen.

I can’t think of an easy way to accomplish what you want but one more complicated possibility would be to make an API call to see if the push commit is seen in any recent pull requests. If it’s not then you know it’s a hotfix push.

edit: clarified that your events don’t happen on open. Also, in the end you’ll probably want a workflow file s…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
1 reply
@thomasInes
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants