Trigger Workflow on Pull Request Merged/Close

Is it possible to trigger a workflow in the context of a merged or closed pull request? For example, we spin up environments for each PR. When the PR is closed or merged the environment needs to be destroyed. I’ve only been able to see where the target branch is built post merge, but doesn’t have any information about where it came from.

4 Likes

Hi @mattfirtion,

did u already find a solution?

The solution I currently had in mind would be to trigger this with a circleci api call through some Github actions. But this would require Auth-Tokens and I don’t really like the solution, because at least we had to rely on external developers to care about that integration in their repositories.

Ideally this would work with the webhook.