Skip to content

[Backport to llvm_release_210] Fix error propagation in parseSPIRV #75

[Backport to llvm_release_210] Fix error propagation in parseSPIRV

[Backport to llvm_release_210] Fix error propagation in parseSPIRV #75

name: Cleanup Backport Branches
on:
pull_request:
types: [closed]
permissions:
contents: write
jobs:
cleanup:
if: >
github.event.pull_request.head.repo.full_name == github.repository &&
startsWith(github.event.pull_request.head.ref, 'backport/pr-')
runs-on: ubuntu-latest
steps:
- name: Delete branch
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const branch = context.payload.pull_request.head.ref;
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${branch}`
});
console.log(`Success. Deleted '${branch}'`);
} catch (error) {
if (error.status === 422) {
console.log(`Branch '${branch}' not found`);
} else {
throw error;
}
}