Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 2.77 KB

File metadata and controls

78 lines (56 loc) · 2.77 KB

gha-slack/react

Add an emoji reaction to a Slack message

Usage

This workflow can be used to react to a Slack message using its message_ts (the unique message ID returned by gha-slack/post).

Prerequisites

Please read the prerequisites

Channel ID

The channel_id must be the channel ID, not the name of the Slack channel. You can find this under "channel details" in Slack.

Examples

React to a message posted in the same workflow:

Idempotency

Adding a reaction is safe to run more than once. If the message already has the same reaction (for example after re-running a workflow), Slack returns already_reacted. The action treats this as success, so the job does not fail. Real errors (invalid token, missing channel, etc.) still fail the job.

Slack Emoji

Supports all emoji's added to Entur's slack organisation, ie:

  • white_check_mark ✅ success / done
  • x ❌ failure
  • rocket 🚀 deployment / release
  • eyes 👀 reviewing / taking a look
  • tada 🎉 celebration
  • warning ⚠️ warning
  • thumbsup 👍 approval
  • +++
jobs:
  post-message:
    uses: entur/gha-slack/.github/workflows/post.yml@v3
    with:
      channel_id: "CHANNEL_ID"
      message: "Deployment started"
    secrets: inherit

  react-to-message:
    needs: post-message
    uses: entur/gha-slack/.github/workflows/react.yml@v3
    with:
      channel_id: "CHANNEL_ID"
      message_ts: ${{ needs.post-message.outputs.message_ts }}
      emoji: "white_check_mark"
    secrets: inherit

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
channel_id string true Slack channel ID where the
message was posted
emoji string true Emoji name to react with
(without colons)
message_ts string true Slack message timestamp (unique message ID) to
react to
timeout_minutes number false 5 Job timeout in minutes

Outputs

No outputs.