From ea58ab6e406fd3ad016a064b31270bbb41127f41 Mon Sep 17 00:00:00 2001 From: Tre Ammatuna <16496746+TreTuna@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:53:16 -0700 Subject: [PATCH] fix: update octokit to use rest --- dist/index.js | 9 ++++++--- index.js | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3e395794..c86917d0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -303,7 +303,10 @@ async function run() { const octokit = new github.getOctokit(githubToken); - const { data: currentPulls } = await octokit.pulls.list({ owner, repo }); + const { data: currentPulls } = await octokit.rest.pulls.list({ + owner, + repo, + }); const currentPull = currentPulls.find((pull) => { return pull.head.ref === fromBranch && pull.base.ref === toBranch; @@ -320,7 +323,7 @@ async function run() { } if (shouldCreatePullRequest) { - const { data: pullRequest } = await octokit.pulls.create({ + const { data: pullRequest } = await octokit.rest.pulls.create({ owner, repo, head: fromBranch, @@ -370,7 +373,7 @@ async function run() { } async function hasContentDifference(octokit, fromBranch, toBranch) { - const { data: response } = await octokit.repos.compareCommits({ + const { data: response } = await octokit.rest.repos.compareCommits({ owner, repo, base: toBranch, diff --git a/index.js b/index.js index 17bc20fa..3b63e8d7 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,10 @@ async function run() { const octokit = new github.getOctokit(githubToken); - const { data: currentPulls } = await octokit.pulls.list({ owner, repo }); + const { data: currentPulls } = await octokit.rest.pulls.list({ + owner, + repo, + }); const currentPull = currentPulls.find((pull) => { return pull.head.ref === fromBranch && pull.base.ref === toBranch; @@ -40,7 +43,7 @@ async function run() { } if (shouldCreatePullRequest) { - const { data: pullRequest } = await octokit.pulls.create({ + const { data: pullRequest } = await octokit.rest.pulls.create({ owner, repo, head: fromBranch, @@ -90,7 +93,7 @@ async function run() { } async function hasContentDifference(octokit, fromBranch, toBranch) { - const { data: response } = await octokit.repos.compareCommits({ + const { data: response } = await octokit.rest.repos.compareCommits({ owner, repo, base: toBranch,