slack-github-action icon indicating copy to clipboard operation
slack-github-action copied to clipboard

Support multiple channel IDs

Open glenthomas opened this issue 2 years ago • 1 comments

Description

The channel-id input supports a single channel ID. Can this be updated to support multiple comma-separated channel ID's?

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

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

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

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

glenthomas avatar Aug 16 '22 12:08 glenthomas

Hi @glenthomas thanks for writing in!

Supporting an array type for the channel-id property seems like a reasonable feature, I went ahead and labeled the issue as an enhancement.

In the mean time I believe using something like multiple steps in a job could be a valid work around for the issue

on: [push]

jobs:
  new_push_job:
    runs-on: ubuntu-latest
    name: Post to slack channels
    steps:
    - name: Publish to slack channel A via bot token
      id: slack
      uses: slackapi/[email protected]
      with:
        channel-id: 'CHANNEL_ID_A'
        slack-message: 'posting from a github action to channel A!'
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
    - name: Publish to slack channel B via bot token
      id: slack
      uses: slackapi/[email protected]
      with:
        channel-id: 'CHANNEL_ID_B'
        slack-message: 'posting from a github action to channel B!'
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

WilliamBergamin avatar Aug 16 '22 15:08 WilliamBergamin

FYI this has been released in v1.22. Big ups to @treemmett for implementing, adding tests and updating the docs ❤️ .

filmaj avatar Sep 13 '22 19:09 filmaj

Thanks! What about message updates. How does it work in this case? I tried passing multiple channels and then updating the messages with the same returned ts. It only updates the message in one of the channels and returns this error: Error: An API error occurred: message_not_found.

amirkarimi avatar Dec 19 '23 23:12 amirkarimi