diff --git a/.github/workflows/delete_staging_branch.yaml b/.github/workflows/delete_staging_and_head_branches.yaml similarity index 56% rename from .github/workflows/delete_staging_branch.yaml rename to .github/workflows/delete_staging_and_head_branches.yaml index 1813917864f..257366d4f41 100644 --- a/.github/workflows/delete_staging_branch.yaml +++ b/.github/workflows/delete_staging_and_head_branches.yaml @@ -1,4 +1,4 @@ -name: Delete PR staging branch +name: Delete PR staging and head branches on: pull_request_target: @@ -9,14 +9,16 @@ on: workflow_dispatch: jobs: - delete-staging-branch: + delete-staging-and-head-branches: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: delete staging branch + - name: Delete staging and head branches env: STAGING_BRANCH: ${{ github.event.pull_request.base.ref }} + HEAD_BRANCH: ${{ github.event.pull_request.head.ref }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -xeo pipefail - git push origin --delete $STAGING_BRANCH + git push origin --delete --force $STAGING_BRANCH + git push origin --delete --force $HEAD_BRANCH