Skip to content

ci: report bundle size with preactjs/compressed-size-action #28

ci: report bundle size with preactjs/compressed-size-action

ci: report bundle size with preactjs/compressed-size-action #28

name: Cleanup Merged Branches
on:
pull_request:
types: [closed]
permissions: {}
jobs:
delete-branch:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
with:
script: |
const branch = context.payload.pull_request.head.ref;
if (['master', 'main', 'next'].includes(branch)) return;
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${branch}`,
});
console.log(`Deleted branch: ${branch}`);
} catch (e) {
console.log(`Branch ${branch} already deleted or protected`);
}