Skip to content

Commit

Permalink
Refactor merged branch deletion (#504)
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya authored Sep 18, 2024
1 parent 5cc8d08 commit 2fea7ab
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/delete-backport-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ on:
jobs:
delete-branch:
runs-on: ubuntu-latest
permissions:
contents: write
if: 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 branch
uses: actions/github-script@v5
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 2fea7ab

Please sign in to comment.