From f04491c3ba7211305c827f38e39a16e76f1dedfc Mon Sep 17 00:00:00 2001 From: yoonseo choi Date: Thu, 18 Jul 2024 14:06:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=8A=AC=EB=9E=99=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EB=A9=98=EC=85=98=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88e19212..ae42d762 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,13 +46,15 @@ jobs: *) SLACK_USER_ID="" ;; esac echo "::set-output name=slack_user_id::$SLACK_USER_ID" - echo "::set-output name=slack_mention::@${{ steps.slack-user-mapping.outputs.slack_user_id }}" - - name: Prepare Slack payload - id: prepare-slack-payload + - name: Prepare Slack mention + id: prepare-slack-mention run: | - MENTION="<@${{ steps.slack-user-mapping.outputs.slack_user_id }}" - echo "::set-output name=slack_mention::${MENTION}" + if [ "${{ steps.slack-user-mapping.outputs.slack_user_id }}" != "" ]; then + echo "::set-output name=slack_mention::<@${{ steps.slack-user-mapping.outputs.slack_user_id }}>" + else + echo "::set-output name=slack_mention::" + fi - name: Send Slack notification uses: 8398a7/action-slack@v3 @@ -60,7 +62,7 @@ jobs: status: ${{ job.status }} author_name: Github Action Test fields: repo,pullRequest,eventName,author,message,commit,action,took - mention: ${{ steps.prepare-slack-payload.outputs.slack_mention }} + mention: '${{ steps.prepare-slack-mention.outputs.slack_mention }}' if_mention: failure,cancelled env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}