From 9fc989367c945595d45f1b71098f5b862f730242 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 22 Apr 2022 23:12:13 +0300 Subject: [PATCH] test sending random slack notification --- src/develop_actions.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/develop_actions.js b/src/develop_actions.js index ec48ee0..fa76d8d 100644 --- a/src/develop_actions.js +++ b/src/develop_actions.js @@ -40,6 +40,7 @@ const run = async () => { base: "staging", } ); + console.log(createpr?.data); if (createpr?.data) { axios .post( @@ -54,6 +55,21 @@ const run = async () => { .catch((error) => { console.log("FAILED: Send slack webhook", error); }); + } else { + // fetch pr from branch_name to staging + // update existing pr + console.log("pr exists"); + axios + .post( + SLACK_WEBHOOK_URL, + JSON.stringify(`PR from ${branch_name} to staging already exist`) + ) + .then((response) => { + console.log("SUCCEEDED: Sent slack webhook", response.data); + }) + .catch((error) => { + console.log("FAILED: Send slack webhook", error); + }); } const compare_commits = await octokit.request( `GET /repos/${context.payload?.repository?.full_name}/compare/staging...${branch_name}`,