From 212b2aea16503568bafa0b14e1923c38c5e54322 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Fri, 4 Nov 2022 00:14:41 -0400 Subject: [PATCH] releases: allow publishing discord announcements to multiple webhooks --- .../scripts/releases/announce-release/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/releases/announce-release/index.js b/.github/workflows/scripts/releases/announce-release/index.js index 23671ac669..f9147bb5cb 100644 --- a/.github/workflows/scripts/releases/announce-release/index.js +++ b/.github/workflows/scripts/releases/announce-release/index.js @@ -19,7 +19,12 @@ const embed = new MessageEmbed() { name: 'Included Changes', value: releaseInfo.body, inline: false } ); -const webhookClient = new WebhookClient({ url: process.env.DISCORD_BUILD_WEBHOOK }); -await webhookClient.send({ - embeds: [embed], -}); +// Get all webhooks, simple comma-sep string +const webhookUrls = process.env.DISCORD_BUILD_WEBHOOK.split(","); + +for (const url of webhookUrls) { + const webhookClient = new WebhookClient({ url: url }); + await webhookClient.send({ + embeds: [embed], + }); +}