diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 965ae36..64ed39f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ jobs: - name: Build run: npm install - - name: install packages - run: npm install -g axios @octokit/core @actions/github @actions/core - uses: ./ with: GITHUB_TOKEN: ${{secrets.TOKEN}} diff --git a/.gitignore b/.gitignore index e67876a..a56a7ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules - diff --git a/action.yml b/action.yml index c55e067..80b4f06 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: required: true runs: using: 'node16' - main: './src/actions.js' + main: './action/index.js' branding: icon: 'package' 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) { 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) {