Skip to content

Commit

Permalink
fix: 슬랙 메시지 멘션 기능
Browse files Browse the repository at this point in the history
  • Loading branch information
lilychoibb committed Jul 18, 2024
1 parent 6ee096e commit f04491c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,23 @@ 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
with:
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 }}
Expand Down

0 comments on commit f04491c

Please sign in to comment.