Skip to content

Commit 14d9cb3

Browse files
committed
workflow: formatter cleanup
1 parent d8cf9de commit 14d9cb3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)