Skip to content

Refactor branch deletion for backports #19

Refactor branch deletion for backports

Refactor branch deletion for backports #19

name: Delete merged branch of the backport PRs
on:
pull_request:
types:
- closed
jobs:
delete-branch:
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.event.pull_request.head.ref,'backport/')
steps:

Check failure on line 13 in .github/workflows/delete_backport_branch.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/delete_backport_branch.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
- name: Delete merged 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}`,
})