diff --git a/.github/workflows/clean-merged-branch.yml b/.github/workflows/clean-merged-branch.yml new file mode 100644 index 0000000..f276abd --- /dev/null +++ b/.github/workflows/clean-merged-branch.yml @@ -0,0 +1,17 @@ +name: Delete merged branches in fork + +on: + pull_request: + types: + - closed + +jobs: + delete_branch: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - name: Delete merged branch from fork + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git push origin --delete ${{ github.event.pull_request.head.ref }}