Action for pull_request closed does not run when merged=false

I’m using a github action with this event trigger to tear down an AWS stack after a PR is closed.

on:
  pull_request:
    types: [closed]

However, this only seems to run when a PR is merged, and not when it is closed without merging changes.

Am I missing something in my event specification or is this a bug?

1 Like

I tested in my side, close pull request without merge could trigger a workflow with 

on:
  pull_request:
    types: [closed]

You could enableSteps debug logging to see your github event context.

Do you use a public repo? Could you please share your workflow run example here? 

I have exactly the same problem - no action is triggered at all (so there is nothing in the context to debug…) - have you solved it on your end?

@luludan @rokroskar When a PR has conflicts then none of the PR related workflows are triggered.

REF: Resolve PR conflicts in an action?

I faced similar behaviour and found out that my PR had conflicts.