Skip to content

Commit 3d997d3

Browse files
committed
add github workflow
1 parent 34fe26b commit 3d997d3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/main.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Delete Merged Branch
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
jobs:
9+
delete_branch:
10+
if: github.event.pull_request.merged == true
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.event.pull_request.base.ref }} # Checkout the target branch
19+
20+
- name: Delete source branch
21+
run: |
22+
git push origin --delete ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)