Trigger a workflow when a PR is closed
F
Francis Francis
We currently use CircleCI to deploy branch specific CloudFormation stacks for all branches with open PRs. This gives us the flexibility to develop features using isolated AWS resources and allows us to test our infrastructure along with our code. For branch stack deployments and updates this workflow works very well, a new branch stands up a new stack and any changes to that branch update the associated CloudFormation stack. The issue is that there is currently no way to clean up these stacks after a branch is closed and the PR is merged or rejected. For us this is currently a manual process.
It would be great if CircleCI exposed workflow triggers for more GitHub events. Specifically we would really benefit from a workflow that was triggered by a PR closed event or a branch delete event.
Alex Milkovskyi
Alternatively workflow can be started via hook when a branch is deleted.
Nicolas CANIART
Might relate to https://ideas.circleci.com/api-feature-requests/p/expose-github-webhook-events-and-status-message-api which has seen more attention.
Nicolas CANIART
CloudFormation or not, any company doing serious continuous deployment in dev, staging and prod environments would be greatly helped, by this feature. The ability to trigger jobs to clean-up whatever resources used to test a PR request, when it is scrubbed, would very useful. It would keep environments clean, lower wasted resources and hence help save the planet.
It's really sad to see that this request has not seen much attention yet.
Daniel Kreß
Same here. There is the possibility to add an approval to the CircleCI config that is followed by a CloudFormation stack delete and approve it
only
when you are done with the stack but it's an ugly workaround and only eases the pain... but doesn't work fully automated.