Make it possible to let branch deletion wait until environment has stopped
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=22943) </details> <!--IssueSummary end--> ### Problem to solve Sometimes the stop action of an environment needs to have access to a branch. When a branch gets deleted, the stop action is automatically triggered. In that case we should allow waiting for the stop action to complete before the branch is deleted. ### Further details see also discussion in https://gitlab.com/gitlab-org/gitlab-ce/issues/45658 ### Proposal - always run stop action first and then delete branch (this will delay branch deletion significantly) or - pass SHA of last commit on the deleted branch to the stop action (this will work until the next run of `git gc`) or - add configuration to run stop actions before branch deletions—in project settings or `.gitlab-ci.yml` <!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION --> *This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.* <!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
issue