Skip to content

Commit

Permalink
Fix backport branch deletion on merge (#2255)
Browse files Browse the repository at this point in the history
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com>
(cherry picked from commit 3554ebf)

Co-authored-by: Kunal Kotwani <kkotwani@amazon.com>
  • Loading branch information
1 parent 2851844 commit 3d1649d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/delete_backport_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ on:
jobs:
delete-branch:
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.head.ref,'backport/')
permissions:
contents: write
if: github.repository == 'opensearch-project/k-NN' && startsWith(github.event.pull_request.head.ref,'backport/')
steps:
- name: Delete merged branch
uses: SvanBoxel/delete-merged-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete merged branch
uses: actions/github-script@v7
with:
script: |
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${context.payload.pull_request.head.ref}`,
})

0 comments on commit 3d1649d

Please sign in to comment.