Skip to content

Commit 6a208e5

Browse files
Coldwingslihuiba
authored andcommitted
auto delete auto-pr branch which is merged
1 parent 2986240 commit 6a208e5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Auto PR Branch Cleanup
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
jobs:
9+
clean-auto-pr:
10+
if: ${{ github.event.pull_request.merged }} &&
11+
${{ github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id }} &&
12+
${{ github.event.pull_request.head.ref == 'auto-pr-*' }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: set git config
20+
run: |
21+
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
22+
git config --global user.name "${GITHUB_ACTOR}"
23+
git config --global advice.mergeConflict false
24+
git config --global --add safe.directory "${{ github.workspace }}"
25+
git config -l
26+
git push -d origin ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)