From c226cd30124eb8a5330470ebd03d6e08f2a61470 Mon Sep 17 00:00:00 2001 From: Tom Ballaam Date: Sat, 13 Jan 2024 20:38:57 -0600 Subject: [PATCH] Update pr-poster.js --- .github/scripts/pr-poster.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/scripts/pr-poster.js b/.github/scripts/pr-poster.js index c120dbbe..875e1569 100644 --- a/.github/scripts/pr-poster.js +++ b/.github/scripts/pr-poster.js @@ -157,17 +157,20 @@ async function run() { } ) } + const webhookUrl = process.env.DISCORD_WEBHOOK; const options = { + method: "POST", + url: webhookUrl, + headers: { "Content-Type": "application/json" }, content: `New Pull Request from ${user}`, - embeds: embeds_arr, + data: JSON.stringify({embeds_arr}), } - const webhookUrl = process.env.DISCORD_WEBHOOK; - axios.post(webhookUrl, options) + axios.post(options) .then(whresp => { console.log('Message sent successfully:', whresp.data); }) - .catch(wherr => { - console.error('Error sending message:', wherr.message); + .catch(error => { + console.log(error.message); process.exit(1); }); } catch (error) {