Skip to content

Add auto-cleanup for merged feature branches #1

Add auto-cleanup for merged feature branches

Add auto-cleanup for merged feature branches #1

name: Cleanup merged branches
on:
pull_request:
types: [closed]
permissions:
contents: write
jobs:
delete-branch:
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref != 'dev' && github.event.pull_request.head.ref != 'release'
runs-on: ubuntu-latest
steps:
- name: Delete merged branch
run: gh api repos/${{ github.repository }}/git/refs/heads/${{ github.event.pull_request.head.ref }} -X DELETE
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}