rtCamp/action-slack-notify

[Question] Create mention when a deploy happens

Closed this issue · 2 comments

Is there a way to enable slack mentions via this github action. I created a Github <-> Slack integration by doing /github login in slack for the user (github.actor) as a way to test, but it didn't seem to work. I did see my github username in the post but it didn't seem to do the mention part.

env:
          ....
          SLACK_MESSAGE: 'Deployed ${{ github.head_ref }} to staging :rocket: <@${{ github.actor }}>'
          ...
          SLACK_LINK_NAMES: true
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEPLOYMENT }}

Discussion started back here

#103

To mention a user, Slack requires you to format in <@USER-ID> format, as specified in their documentation about mentioning users. Therefore, you'd want to get the Slack ID for the user you're looking to mention.