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 d8cf9de commit 14d9cb3Copy full SHA for 14d9cb3
.github/workflows/delete-formatting-branch.yml
@@ -0,0 +1,22 @@
1
+name: Delete Formatting Branch After Merge
2
+
3
+on:
4
+ pull_request:
5
+ types: [closed]
6
7
+jobs:
8
+ delete-branch:
9
+ if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'autopep8-formatting/')
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ steps:
14
+ - name: Delete branch after merge
15
+ run: |
16
+ BRANCH="${{ github.head_ref }}"
17
+ echo "Deleting branch: $BRANCH"
18
+ git config --global user.name 'github-actions[bot]'
19
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
20
+ git clone --depth=1 https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} repo
21
+ cd repo
22
+ git push origin --delete "$BRANCH"
0 commit comments