Skip to content

Commit

Permalink
Improve README to clearly mention a channel ID is required for updati…
Browse files Browse the repository at this point in the history
…ng messages

#137
  • Loading branch information
seratch authored Oct 11, 2022
1 parent 71bf093 commit 0ae8044
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,14 @@ Using JSON payload for constructing a message is also available:

If you would like to notify the real-time updates on a build status, you can modify the message your build job posted in the subsequent steps. In order to do this, the steps after the first message posting can have `update-ts: ${{ steps.slack.outputs.ts }}` in their settings. With this, the step updates the already posted channel message instead of posting a new one.

Please note that **the message update step does not accept a channel name.** Set a channel ID for the steps for the actions that update messgages.

```yaml
- id: slack
uses: slackapi/slack-github-action@v1.22.0
with:
# The following message update step does not accept a channel name.
# Setting a channel ID here for consistency is highly recommended.
channel-id: "CHANNEL_ID"
payload: |
{
Expand All @@ -155,6 +159,8 @@ If you would like to notify the real-time updates on a build status, you can mod
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN}}
- uses: slackapi/slack-github-action@v1.22.0
with:
# Unlike the step posting a new message, this step does not accept a channel name.
# Please use a channel ID, not a name here.
channel-id: "CHANNEL_ID"
update-ts: ${{ steps.slack.outputs.ts }}
payload: |
Expand Down

0 comments on commit 0ae8044

Please sign in to comment.