From 5781fb5170ef893ef69c2d921bef9d6fc6dc51af Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Apr 2022 14:33:01 +0300 Subject: [PATCH 1/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 2/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 2639128eaab5331a00339fb89f646c97648e1ec6 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Apr 2022 14:38:47 +0300 Subject: [PATCH 3/4] add build file --- src/actions.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/actions.js b/src/actions.js index 10f2f41..ce56733 100644 --- a/src/actions.js +++ b/src/actions.js @@ -20,8 +20,6 @@ const run = async () => { branch_name = context.payload.ref?.replace("refs/heads/", ""); } - console.log(branch_name); - // fetching commits let commits = ""; try { @@ -167,7 +165,6 @@ 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, From 0ebe671a8ce5007ab8632f0c9d602cb00ac95d86 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Apr 2022 14:39:02 +0300 Subject: [PATCH 4/4] add build file --- action/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/action/index.js b/action/index.js index 513d08b..9850da2 100644 --- a/action/index.js +++ b/action/index.js @@ -12417,8 +12417,6 @@ const run = async () => { branch_name = context.payload.ref?.replace("refs/heads/", ""); } - console.log(branch_name); - // fetching commits let commits = ""; try { @@ -12564,7 +12562,6 @@ 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,