Skip to content

It's an MCP server now xD! #52

It's an MCP server now xD!

It's an MCP server now xD! #52

name: Delete merged branch
on:
pull_request:
types: [closed]
jobs:
delete-branch:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/github-script@v7
with:
script: |
const branch = context.payload.pull_request.head.ref;
if (branch === 'main' || branch === 'master') return;
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${branch}`,
});