voxmedia / github-action-slack-notify-build

Report GitHub Actions build status on Slack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notify specific user on status

antondalgren opened this issue · comments

I would like the possibility to notify a specific user in the message that's posted to a channel using the user_id of the specific user.

The use-case is that everyone in the team should see the notification but the one that pushed a failing pipeline should be explicitly notified.

Not sure if its the best solution for you problem but you can mention people in the "status" field for a notifications.

  • So if I want to mention a user I would do <@user-id>, where user-id is the user's slack ID.
  • If I want to mention a group I would use <!subteam^group-id> where group-id is the group's slack ID.
    • To find out what the group slack ID is you can log into the workplace via the website, not the native app, and go to "People and User Groups" then tap a group and copy the ID from the URL.

An example for the mention in the status is:

uses: voxmedia/github-action-slack-notify-build@v1
with:
  channel: app-alerts
  status: STARTED | <@U4HD520SH> | <!subteam^UXHD527YH>
  color: good
env:
  SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}