Skip to content

Commit 734fec6

Browse files
gaiksayadk2k
authored andcommitted
Refactor branch deletion for backports (opensearch-project#15983)
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
1 parent c78f53a commit 734fec6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/delete_backport_branch.yml

Lines changed: 10 additions & 3 deletions
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:
1214
- name: Delete merged branch
13-
uses: SvanBoxel/delete-merged-branch@main
14-
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
uses: actions/github-script@v5
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)