Currently we run the cleanup job in the build-and-run-batch-job workflow on closed PRs:
|
cleanup: |
|
# Only run on closed PRs, to destroy staging resources |
|
# yamllint disable-line rule:line-length |
|
if: github.event_name == 'pull_request' && github.event.action == 'closed' |
However, we run many of our Batch jobs on branches that we never end up putting up as PRs. As a result, we've accumulated a bunch of old Batch resources that we never use from zombie branches.
We should update our conditional logic for this job to also run on the delete event so that we can clean up resources if a branch is deleted but was never put up as a PR.