diff --git a/README.md b/README.md index e0a629e..d5afa16 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ with: slack_webhook: ${{ secrets.SLACK_WEBHOOK }} telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }} telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }} + telegram_message_thread_id: ${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }} google_chat_webhook: ${{ secrets.GOOGLE_CHAT_WEBHOOK }} ms_teams_webhook: ${{ secrets.MS_TEAMS_WEBHOOK }} title: "Deploy to Dev" @@ -64,6 +65,7 @@ jobs: slack_webhook: ${{ secrets.SLACK_WEBHOOK }} telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }} telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }} + telegram_message_thread_id: ${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }} google_chat_webhook: ${{ secrets.GOOGLE_CHAT_WEBHOOK }} ms_teams_webhook: ${{ secrets.MS_TEAMS_WEBHOOK }} title: "Deploy to Dev" @@ -82,7 +84,7 @@ jobs: slack_webhook: ${{ secrets.SLACK_WEBHOOK }} telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }} telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }} - telegra_message_thread_id: $ {{ secrets.TELEGRAM_MESSAGE_THREAD_ID }} + telegram_message_thread_id: ${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }} google_chat_webhook: ${{ secrets.GOOGLE_CHAT_WEBHOOK }} ms_teams_webhook: ${{ secrets.MS_TEAMS_WEBHOOK }} title: "Deploy to Dev" diff --git a/src/utils.ts b/src/utils.ts index e0bdda4..5016a46 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -41,6 +41,7 @@ export const getInputs = (): TInputs => { const slack_username = getInput('slack_username').trim() || ''; const telegram_bot_token = getInput('telegram_bot_token').trim() || ''; const telegram_chat_id = getInput('telegram_chat_id').trim() || ''; + const telegram_message_thread_id = getInput('telegram_message_thread_id').trim() || ''; const google_chat_webhook = getInput('google_chat_webhook').trim() || ''; const ms_teams_webhook = getInput('ms_teams_webhook').trim() || ''; const status = getInput('status').trim() || ''; @@ -55,6 +56,7 @@ export const getInputs = (): TInputs => { slack_username, telegram_bot_token, telegram_chat_id, + telegram_message_thread_id, google_chat_webhook, ms_teams_webhook, title, @@ -263,8 +265,11 @@ export function getPayloadTelegram(inputs: Readonly): Object { parse_mode: 'MarkdownV2', }; - if (inputs.telegram_message_thread_id) { - telegram_payload.message_thread_id = inputs.telegram_message_thread_id; + if (inputs.telegram_message_thread_id !== "") { + telegram_payload = { + ...telegram_payload, + message_thread_id: inputs.telegram_message_thread_id + } } return telegram_payload;