From 6a6319af04b542abb7dce587bb0f30def4bb4c95 Mon Sep 17 00:00:00 2001 From: Aviv Meydan Date: Tue, 21 Jan 2025 22:09:20 +0200 Subject: [PATCH] Add github workflow --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f53e200 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: Delete Merged Branch + +on: + pull_request: + types: + - closed + +jobs: + delete_branch: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.ref }} # Checkout the target branch + + - name: Delete source branch + run: | + git push origin --delete ${{ github.event.pull_request.head.ref }}