From 041c4470f3cca66cdfad78866e33fedfd3839cf0 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 22 Apr 2022 23:24:08 +0300 Subject: [PATCH 1/2] test sending random slack notification --- src/develop_actions.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/develop_actions.js b/src/develop_actions.js index 783b46a..fe50928 100644 --- a/src/develop_actions.js +++ b/src/develop_actions.js @@ -16,9 +16,20 @@ const run = async () => { .slice(1) .join("/"); + const compare_commits = await octokit.request( + `GET /repos/${context.payload?.repository?.full_name}/compare/staging...${branch_name}`, + { + owner: context.payload?.repository?.owner?.login, + repo: context.payload?.repository?.name, + base: "staging", + head: branch_name, + } + ); + console.log("compare commit", compare_commits); + let commits = ""; - context.payload?.commits?.forEach((e, i) => { + compare_commits?.data?.commits?.forEach((e, i) => { if ( !e.message.includes("Merge") && !e.message.includes("Merged") && @@ -44,16 +55,6 @@ const run = async () => { base: "staging", } ); - const compare_commits = await octokit.request( - `GET /repos/${context.payload?.repository?.full_name}/compare/staging...${branch_name}`, - { - owner: context.payload?.repository?.owner?.login, - repo: context.payload?.repository?.name, - base: "staging", - head: branch_name, - } - ); - console.log("compare commit", compare_commits); if (createpr?.data) { axios .post( From 731dd45deaa8fb2500bc4f734419ef45b8486caa Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 22 Apr 2022 23:24:33 +0300 Subject: [PATCH 2/2] test sending random slack notification --- src/develop_actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/develop_actions.js b/src/develop_actions.js index fe50928..bc616f7 100644 --- a/src/develop_actions.js +++ b/src/develop_actions.js @@ -25,7 +25,7 @@ const run = async () => { head: branch_name, } ); - console.log("compare commit", compare_commits); + console.log("compare commit", compare_commits?.data?.commits); let commits = "";