Skip to content

Rename file name of github workflow #22

Rename file name of github workflow

Rename file name of github workflow #22

name: Delete Unmerged Branch
on:
pull_request:
branches: [ 15.0 ]
types: [ closed ]
jobs:
worker:
if: ${{ github.event.pull_request.merged_at == '' }}
runs-on: ubuntu-22.04
steps:
- name: delete-unmerged-branch
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { repo, owner } = context.repo;
const ref = `heads/${context.payload.pull_request.head.ref}`;
const deleteParams = { owner, repo, ref };
console.log(`Deleting branch: "${ref}"`);
try {
github.rest.git.deleteRef(deleteParams);
} catch(e) {
console.log("Cannot delete branch; error:", e);
}