From 736a02216ef47481546da13f4f9e094748bc3ebd Mon Sep 17 00:00:00 2001 From: Marian Soltys <41568766+maso7@users.noreply.github.com> Date: Tue, 1 Nov 2022 12:12:39 +0100 Subject: [PATCH] Add channel_id output parameter --- action.yml | 2 ++ src/slack-send.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 7365646e..23fc7929 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 e204c049..bae1a34d 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();