validate payload and pass to message
This commit is contained in:
@@ -28,9 +28,9 @@ try {
|
||||
const channelId = core.getInput('channel-id');
|
||||
const web = new WebClient(botToken);
|
||||
|
||||
if (channelId.length > 0 && message.length > 0) {
|
||||
if (channelId.length > 0 && (message.length > 0 || payload)) {
|
||||
// post message
|
||||
web.chat.postMessage({ text: message, channel: channelId });
|
||||
web.chat.postMessage({ channel: channelId, text: message, ...(payload ?? {}) });
|
||||
} else {
|
||||
console.log('missing either channel-id, slack-message or payload! Did not send a message via chat.postMessage with botToken');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user