Skip to content

[김수영] sprint9 #119

[김수영] sprint9

[김수영] sprint9 #119

name: delete branch on close pr
on:
pull_request:
types: [closed]
jobs:
delete-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check if branch exists
id: check_branch
run: |
if git show-ref --verify --quiet refs/heads/${{ github.head_ref }}; then
echo "branch_exists=true" >> $GITHUB_ENV
else
echo "branch_exists=false" >> $GITHUB_ENV
fi
- name: Delete branch
if: env.branch_exists == 'true'
uses: SvanBoxel/delete-merged-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}