Skip to content

Trigger workflow for a pull request and for all subsequent commits in it #25161

Answered by BrightRan
raunaqgupta asked this question in Actions
Discussion options

You must be logged in to vote

@raunaqgupta ,

I think you have some misunderstandings about Push event, Push event will be triggered when you directly push commits to a repository branch or push tags to the repository.
If you wants a workflow runs for pull request, in the YAML file of this workflow, you should set it runs on the events that are related to pull request (such as Pull request event and Pull request review event), not Push event.

For example:

on:
  pull_request:
    types: [assigned, opened, synchronize, reopened]

on:
pull_request_review:
types: [edited, dismissed]

In an opening PR, if you want the subsequent commits pushed to this PR can trigger the workflow, you can set the workflow runs on the activity…

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
@ganeshgk
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
4 participants