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

Re: pull_request action does not run on merge

Thanks for fixing this, I've tried it and works as expected

Copilot Lvl 3
Message 12 of 16

Re: pull_request action does not run on merge

Would it make sense to have a PR event of `merged`?

Copilot Lvl 2
Message 13 of 16

Re: pull_request action does not run on merge

Any Success to fire the event for merge only ?

 

Copilot Lvl 2
Message 14 of 16

Re: pull_request action does not run on merge

Hi,

 

I am using

 

on:
  pull_request:
    types: [closed]

 

for my workflow trigger, without any conditionals, but it is still not triggering when a PR merges. The PR is being merged by a different GitHub Action that merges it using GitHub API with

uses: actions/github-script@0.2.0

 

Could that be a reason it wouldn't trigger?  If I manually merge a PR, it triggers as expected.

 

I've also tried

on: push

where the merge does a push, but same results. A manual merge triggers the workflow based on push, but the merge via API and the github actions bot does not trigger the workflow in question..

Copilot Lvl 2
Message 15 of 16

Re: pull_request action does not run on merge

I have the exact same problem as @rcasperson-jc:

 

Manually merging a pull request triggers my Action, but using the Github API in an other Action to merge a pull request does not trigger my Action.

The only difference I can see is that the merge in the latter case is done by the user github-action (bot).

 

Is it by design / a limitation / a bug of Github Actions?

Copilot Lvl 2
Message 16 of 16

Re: pull_request action does not run on merge

Okay I figured out why my Action wouldn't start.

 

As stated in the doc: "An action in a workflow run can't trigger a new workflow run" (Events that trigger workflows).

 

I had a script in a step that did some changes to my repo with the ${{secrets.GITHUB_TOKEN}} parameter. I expected those changes to trigger another workflow but  they didn't.

By using a personal Github token instead I was able to make it work because now the user responsible for repo changes is not github-actions who obviously cannot trigger workflow, but me.

 

Hope it'll save some time to people