We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ef7c61 commit 1d36576Copy full SHA for 1d36576
1 file changed
.github/workflows/delete-merged-branch.yml
@@ -0,0 +1,24 @@
1
+name: Delete "update" branch after merge
2
+
3
+on:
4
+ pull_request:
5
+ types: [closed]
6
7
+jobs:
8
+ delete-branch:
9
+ if: >
10
+ github.event.pull_request.merged == true &&
11
+ startsWith(github.event.pull_request.head.ref, 'updates/update_')
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+ steps:
16
+ - name: Delete branch
17
+ env:
18
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19
+ run: |
20
+ BRANCH="${{ github.event.pull_request.head.ref }}"
21
+ echo "Deleting branch: $BRANCH"
22
+ gh api \
23
+ -X DELETE \
24
+ repos/${{ github.repository }}/git/refs/heads/$BRANCH
0 commit comments