From 711ae052020ab937922c3591c9e86768e929966d Mon Sep 17 00:00:00 2001 From: hana Date: Sun, 12 May 2024 23:44:30 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20delete=20branch=20=ED=99=9C=EC=84=B1?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CHECK_PR_MERGED.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CHECK_PR_MERGED.yml b/.github/workflows/CHECK_PR_MERGED.yml index acb38a07..52622197 100644 --- a/.github/workflows/CHECK_PR_MERGED.yml +++ b/.github/workflows/CHECK_PR_MERGED.yml @@ -17,10 +17,25 @@ jobs: script: | const prUrl = context.payload.pull_request.html_url ?? context.payload.pull_request._links.html.href; core.setOutput('pullRequestLink', JSON.stringify(prUrl)); + - name: Send Slack Trigger run: | curl -X POST https://api-slack.internal.bcsdlab.com/api/pr-merged/frontend \ -H 'Content-Type: application/json' \ -d '{ "pullRequestLink": ${{ steps.check_pr_merged.outputs.pullRequestLink }} - }' \ No newline at end of file + }' + + - name: Get branch names + id: get_branch_name + run: | + baseBranch=${{ github.event.pull_request.base.ref }} + headBranch=${{ github.event.pull_request.head.ref }} + echo "::set-output name=baseBranch::${baseBranch}" + echo "::set-output name=headBranch::${headBranch}" + + - name: Delete Branch + if: ${{ steps.get_branch_name.outputs.headBranch != 'main' && steps.get_branch_name.outputs.headBranch != 'develop' }} + run: | + git checkout ${{ steps.get_branch_name.outputs.baseBranch }} + git push origin --delete ${{ steps.get_branch_name.outputs.headBranch }}