Skip to content

Commit

Permalink
Update pr-poster.js
Browse files Browse the repository at this point in the history
  • Loading branch information
theballaam96 committed Jan 14, 2024
1 parent d2c84b4 commit c226cd3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/scripts/pr-poster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c226cd3

Please sign in to comment.