diff --git a/.github/workflows/delete-closed-pr-branches.yml b/.github/workflows/delete-closed-pr-branches.yml new file mode 100644 index 0000000000..c0e1df9b82 --- /dev/null +++ b/.github/workflows/delete-closed-pr-branches.yml @@ -0,0 +1,17 @@ +name: Delete Branches on PR Close +on: + pull_request: + types: + - closed +jobs: + delete-branch: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Delete branch + run: | + # Get the branch name from the pull request + BRANCH_NAME=$(echo "${{ github.event.pull_request.head.ref }}") + # Delete the branch + git push origin --delete "$BRANCH_NAME" \ No newline at end of file