Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 4

Run workflow after pushing changes to a PR

Solved! Go to Solution.

One of my workflows is set to run like this

 

on:
 pull_request:
    types: [review_requested, edited]


The workflow runs correctly after I request a review on the PR.

However, when I need to fix something on the PR, make the necessary changes locally and push it to remote, the workflow is not triggered.
I searched in the documentation for when the edited type is triggered and it seems it should be triggered in this situation, or am I missing something?

3 Replies
Solution
GitHub Partner
Message 2 of 4

Re: Run workflow after pushing changes to a PR

Hi Peter,

 

If you make some changes to the files(eg: resolve conflicts), push to github, please use type ‘synchronize ’ for pull request to trigger the workflow, it works on my side, code as below:

 

name: Pull request check

on:

  pull_request:

    types: [synchronize]

 

For type ‘edited’, I tried to use rest api locally to update Pull request(please refer to https://developer.github.com/v3/pulls/#update-a-pull-request), it’s successful to trigger the workflow.

 

Checked the pull request content from API result, you will find the file update/new commit is not included.

Copilot Lvl 2
Message 3 of 4

Re: Run workflow after pushing changes to a PR

Ok thanks!

So type 'edited' is only triggered when updating PR title, body, state or base?

GitHub Partner
Message 4 of 4

Re: Run workflow after pushing changes to a PR

Yes, the 'edited' type is triggered when updating PR itself, including title, body, state, base, and other stuff.

Details we can check the PR content from API result for confirmation, thanks.