The GitHub Actions integration is really nice since it automatically creates new stacks for feature branches (anything which starts with feature). However, those feature branch stacks add up and are not removed automatically. This puts the burden on the developer to 1) realize this behavior and 2) clean up unused feature stacks manually.
Steps to reproduce
Create a SAM Pipeline with GitHub Actions integration (using basic "hello world" SAM app will suffice)
Create a new branch named feature/my-test or feature-my-test
Note in the CloudFormation console that you get a new CFN stack named my-test, which is fully functional
Delete the feature branch
Note that the my-test stack remains
Expected behavior
After I delete a branch, the CFN feature stack is deleted.
Suggestions
This can be accomplished with the new sam delete command and tapping into the delete GitHub action. Trigger the delete GitHub action when the feature branch is deleted. Skip all testing and other building on the delete event. Make sure that the other Actions do not run on the delete GH Action.
The GitHub Actions integration is really nice since it automatically creates new stacks for feature branches (anything which starts with
feature
). However, those feature branch stacks add up and are not removed automatically. This puts the burden on the developer to 1) realize this behavior and 2) clean up unused feature stacks manually.Steps to reproduce
feature/my-test
orfeature-my-test
my-test
, which is fully functionalmy-test
stack remainsExpected behavior
After I delete a branch, the CFN feature stack is deleted.
Suggestions
This can be accomplished with the new
sam delete
command and tapping into thedelete
GitHub action. Trigger thedelete
GitHub action when the feature branch is deleted. Skip all testing and other building on thedelete
event. Make sure that the other Actions do not run on thedelete
GH Action.