From 5781fb5170ef893ef69c2d921bef9d6fc6dc51af Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 Apr 2022 14:33:01 +0300 Subject: [PATCH 1/2] 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/2] 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) {