From 130a5f137c9ea97ab5fd0d9926ab176311568329 Mon Sep 17 00:00:00 2001 From: Benedict Steven <48621248+bmsteven@users.noreply.github.com> Date: Mon, 25 Apr 2022 00:05:33 +0300 Subject: [PATCH 1/4] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e67876a..fbc2b7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules - +.env From 5781fb5170ef893ef69c2d921bef9d6fc6dc51af Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Apr 2022 14:33:01 +0300 Subject: [PATCH 2/4] fix pull requests filter method --- src/actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actions.js b/src/actions.js index e2917b8..10f2f41 100644 --- a/src/actions.js +++ b/src/actions.js @@ -167,12 +167,13 @@ const run = async () => { run(); const createorupdatepr = async ({ branch, owner, repo, body, full_name }) => { + console.log("head-branch", branch); try { const existing_pr = await octokit.rest.pulls.list({ owner, repo, state: "open", - head: branch, + head: owner + ":" + branch, base: DESTINATION_BRANCH, }); if (existing_pr?.data?.length === 0) { From 8364d9b47450f3723bf0388ab51bf5df354db370 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Apr 2022 14:33:26 +0300 Subject: [PATCH 3/4] add build file --- action/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action/index.js b/action/index.js index 10f5931..513d08b 100644 --- a/action/index.js +++ b/action/index.js @@ -12406,7 +12406,6 @@ const octokit = github.getOctokit(GITHUB_TOKEN); const { context = {} } = github; const run = async () => { - // check branch; let branch_name = context.payload?.head_commit?.message ?.split("from")[1] ?.split("\n")[0] @@ -12418,6 +12417,8 @@ const run = async () => { branch_name = context.payload.ref?.replace("refs/heads/", ""); } + console.log(branch_name); + // fetching commits let commits = ""; try { @@ -12563,12 +12564,13 @@ const run = async () => { run(); const createorupdatepr = async ({ branch, owner, repo, body, full_name }) => { + console.log("head-branch", branch); try { const existing_pr = await octokit.rest.pulls.list({ owner, repo, state: "open", - head: branch, + head: owner + ":" + branch, base: DESTINATION_BRANCH, }); if (existing_pr?.data?.length === 0) { From b7ee3a60285c9eab3582e38fb52ce2f0908e2df0 Mon Sep 17 00:00:00 2001 From: Benedict Steven <48621248+bmsteven@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:35:53 +0300 Subject: [PATCH 4/4] Update .gitignore --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index a18f38a..3c3629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ node_modules - - -.env