slackapi / slack-github-action

Send data into Slack using this GitHub Action!
MIT License
938 stars 148 forks source link

When updating a message it seems that Channel Name might not be allowed #137

Closed mjaggard closed 2 years ago

mjaggard commented 2 years ago

Description

When updating a message it seems that Channel Name might not be allowed

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version:

node version: 16

OS version(s): Ubuntu 22.04

Steps to reproduce:

  1. Follow the instuctions here https://github.com/slackapi/slack-github-action#update-the-message
  2. Use a Channel Name

Expected result:

The message should be updated and the task should succeed

Actual result:

The "started" message is posted fine but the success and failure messages do not appear in Slack and the GitHub Action fails with

Error: An API error occurred: channel_not_found

Attachments:

seratch commented 2 years ago

Hi @mjaggard, thanks for writing in!

We know this could be confusing but the underlying API for updating a channel message does not accept a channel name unlike the API to post a new message. Please use a channel ID instead. See also: https://github.com/slackapi/slack-github-action/issues/136#issuecomment-1271674074

mjaggard commented 2 years ago

Yes, understood thanks. I consider this to be an example / documentation bug.

The documentation for the channel ID field currently says you can use channel name which is only true in some circumstances. The example of an update could also make it clearer that the field has to contain and ID and not a name.

seratch commented 2 years ago

@mjaggard Thanks for the feedback. I just updated the README to be clearer: https://github.com/slackapi/slack-github-action/commit/0ae8044e6f4bda8d748e93c8d8fbc1d4a3b63f39

Let us close this issue now. We're sorry for the confusion that you had.

mjaggard commented 2 years ago

That's awesome, thank you 😁