From 4f1e385a92ae87473506122ff768d2b10b374911 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:48:58 -0400 Subject: [PATCH 1/2] react --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index f190db6..f3316b5 100644 --- a/index.js +++ b/index.js @@ -46,6 +46,11 @@ async function findThreadByIssueNumber(issueNumber) { return thread; } +async function getStarterMessage(thread) { + const messages = await thread.messages.fetch({ limit: 1 }); + return messages.first(); +} + app.post("/webhook", async (req, res) => { try { // Verify webhook signature @@ -120,6 +125,14 @@ app.post("/webhook", async (req, res) => { if (thread) { if (action === "closed" && pull_request.merged) { await thread.send(`**${sender.login} merged this PR**`); + const message = await getStarterMessage(thread); + if (message) { + await message.react( + message.guild.emojis.cache.find( + (emoji) => emoji.name === "pr_merged", + ), + ); + } } else { await thread.send(`**${sender.login} ${action} this PR**`); } From 505ee257f94a7596dffe1269fd79fdd9d9ab9d31 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:49:06 -0400 Subject: [PATCH 2/2] editorconfig --- .editorconfig | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fb081ea --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +# EditorConfig is awesome: https://EditorConfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true