Skip to content

Commit a71f765

Browse files
committed
Fix backport branch deletion on merge
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com>
1 parent 64bae92 commit a71f765

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/delete_backport_branch.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ on:
77
jobs:
88
delete-branch:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
1012
if: startsWith(github.event.pull_request.head.ref,'backport/')
1113
steps:
12-
- name: Delete merged branch
13-
uses: SvanBoxel/delete-merged-branch@main
14-
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
- name: Delete merged branch
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
github.rest.git.deleteRef({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
ref: `heads/${context.payload.pull_request.head.ref}`,
22+
})

0 commit comments

Comments
 (0)