Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of existing slack post does not work with channel name, only channel id #136

Closed
4 of 10 tasks
brownjeff opened this issue Oct 7, 2022 · 2 comments
Closed
4 of 10 tasks
Labels
question Further information is requested

Comments

@brownjeff
Copy link

brownjeff commented Oct 7, 2022

Description

When using update-ts: to update a previous action's slack post, the error Error: An API error occurred: channel_not_found is thrown.

The update works fine when using the channel ID, but does not work when using channel name.

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

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

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

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

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

Reproducible in:

package version:

node version:

OS version(s):

Steps to reproduce:

  1. Create subsequent actions like:
      - name: Post to a Slack channel
        id: slack
        uses: slackapi/slack-github-action@v1.22.0
        with:
          channel-id: '#mychannel'
          payload: |
            {
              "text": "first message"
            }
      - name: Update Existing Message in Slack
        id: slack_update
        uses: slackapi/slack-github-action@v1.22.0
        with:
          channel-id: '#mychannel'
          update-ts: ${{ steps.slack.outputs.ts }}
          payload: |
            {
              "text": "UPDATED MESSAGE"
            }
  1. Note: token set in env at global level
  2. Execute the workflow
  3. Notice first message is posted to slack
  4. Notice the slack post if never updated.
  5. Notice in github action page an error has occur with message: Error: An API error occurred: channel_not_found

Expected result:

Existing post is updated with the subsequent action.

Actual result:

Notice in github action page an error has occur with message: Error: An API error occurred: channel_not_found

Attachments:

@WilliamBergamin WilliamBergamin added the bug Something isn't working label Oct 7, 2022
@WilliamBergamin
Copy link
Contributor

WilliamBergamin commented Oct 7, 2022

Hi @brownjeff thanks for writing in!

I suspect this may be related to the way the channel information is provided. When posting a message the postMessage method accepts a channel encoded ID, or a name as input. And based on the documentation, in the case of updateMessage only the channel encoded ID can be provided.

let me know if using the channel name instead of the channel_id is the source of this issue

@brownjeff
Copy link
Author

Thanks for the reply @WilliamBergamin

You are correct. Using the channel name instead of the channel_id is the source of this issue.

Thanks for the links to the methods' docs.

I suppose this should not be a bug report here, but a feature request to the Slack API for adding channel-name as a valid alternative to channel-id in the updateMessage call.

Thanks again.

@seratch seratch added question Further information is requested and removed bug Something isn't working labels Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants