diff --git a/action.yml b/action.yml index 7365646..23fc792 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,8 @@ outputs: description: 'The timestamp on the message that was posted into Slack when using bot token' ts: # timestamp of message posted description: 'The timestamp on the message that was posted into Slack when using bot token' + channel_id: # Id of the channel. If channel name was used as input we can get ID from output for later use when updating message or posting to thread. + description: 'The channel id of the message that was posted into Slack when using bot token' runs: using: 'node16' main: 'dist/index.js' diff --git a/src/slack-send.js b/src/slack-send.js index f519836..ed350e8 100644 --- a/src/slack-send.js +++ b/src/slack-send.js @@ -145,6 +145,8 @@ module.exports = async function slackSend(core) { // return the thread_ts if it exists, if not return the ts const thread_ts = webResponse.thread_ts ? webResponse.thread_ts : webResponse.ts; core.setOutput('thread_ts', thread_ts); + // return id of the channel from the response + core.setOutput('channel_id', webResponse.channel); } const time = (new Date()).toTimeString();