From bc5dd6aaef14c663abd44bbb3e6531ec0811bb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=9C=EC=9D=B4=EB=AF=B8?= <63184334+JJ503@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:08:09 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20#740=20PR=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=B6=84=EC=84=9D=20=EC=8B=9C=20suggestion=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=EB=A5=BC=20=EC=9C=84=ED=95=9C=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#765)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: 제안 pr은 수행하지 않도록 수정 * ci: 제안 pr에 대한 github actions workflow 추가 --- .github/workflows/backend_pr_decorator.yml | 3 +- .../backend_suggestion_pr_decorator.yml | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/backend_suggestion_pr_decorator.yml diff --git a/.github/workflows/backend_pr_decorator.yml b/.github/workflows/backend_pr_decorator.yml index e63306202..99b53d4ad 100644 --- a/.github/workflows/backend_pr_decorator.yml +++ b/.github/workflows/backend_pr_decorator.yml @@ -9,7 +9,7 @@ permissions: write-all jobs: build: - if: contains(github.event.pull_request.labels.*.name, 'backend') + if: contains(github.event.pull_request.labels.*.name, 'backend') && !contains(github.event.pull_request.labels.*.name, 'suggestion') runs-on: ubuntu-latest steps: @@ -112,3 +112,4 @@ jobs: SLACK_MESSAGE+='"}}]}' curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}" + diff --git a/.github/workflows/backend_suggestion_pr_decorator.yml b/.github/workflows/backend_suggestion_pr_decorator.yml new file mode 100644 index 000000000..2d8653983 --- /dev/null +++ b/.github/workflows/backend_suggestion_pr_decorator.yml @@ -0,0 +1,52 @@ +name: 제안 PR 슬랙 메시지 + +on: + pull_request: + types: [ opened, reopened, synchronize ] + branches: [ main, develop, develop-be ] + +permissions: write-all + +jobs: + build: + if: contains(github.event.pull_request.labels.*.name, 'backend') && contains(github.event.pull_request.labels.*.name, 'suggestion') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: set author slack id + id: author-slack + run: | + GIT_ID=${{ github.event.pull_request.user.login }} + + if [ "$GIT_ID" == "apptie" ]; then + AUTHOR_NAME="${{ secrets.apptie_slack_display_name }}" + elif [ "$GIT_ID" == "swonny" ]; then + AUTHOR_NAME="${{ secrets.swonny_slack_display_name }}" + elif [ "$GIT_ID" == "JJ503" ]; then + AUTHOR_NAME="${{ secrets.JJ503_slack_display_name }}" + elif [ "$GIT_ID" == "kwonyj1022" ]; then + AUTHOR_NAME="${{ secrets.kwonyj1022_slack_display_name }}" + fi + + echo "AUTHOR_NAME=${AUTHOR_NAME}" >> $GITHUB_OUTPUT + + - name: slack suggestion notification + if: github.event.action != 'synchronize' + run: | + SLACK_MESSAGE='{"text":"제안 PR","blocks":[{"type":"section","text":{"type":"mrkdwn","text":">*제안 PR* \n>\n>*PR Author*\n>' + SLACK_MESSAGE+="${{ steps.author-slack.outputs.AUTHOR_NAME }}" + SLACK_MESSAGE+="\n>\n>*PR 링크*\n><" + SLACK_MESSAGE+="${{ github.event.pull_request.html_url }} " + SLACK_MESSAGE+="> \n>\n>*PR 제목*\n>" + SLACK_MESSAGE+="${{ github.event.pull_request.title }}" + SLACK_MESSAGE+="\n>\n>*리뷰어*\n>" + SLACK_MESSAGE+="" + SLACK_MESSAGE+='"}}]}' + + curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}" + + - name: Force failure + run: exit 1 +