Skip to content

How to prevent running actions on push when pull_request is also specified? #25654

Answered by Yanjingzhu
mfn asked this question in Actions
Discussion options

You must be logged in to vote
  • pull means: check out the “tree on the given commit”, then run action
  • pull_request` means: check out the “tree on given commit and merge with master (or whatever the target is)”, then run action because of what you said:

  > The workflow on pull request is building a pre merged code from dev to master (refs/pull/id/merge)

 

Did I got this right?

Yes, you got it right. The git/tree you mentioned is the GITHUB_REF. You could see the environment variable description here

Note:  I think the ‘pull’ you mentioned above is push. 

Drive-by question: If so, what happens on merge conflicts with master/target branch?

When …

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

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

You must be logged in to vote
0 replies
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
4 participants