Skip to content

Commit ea58ab6

Browse files
committed
fix: update octokit to use rest
1 parent 619327f commit ea58ab6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ async function run() {
303303

304304
const octokit = new github.getOctokit(githubToken);
305305

306-
const { data: currentPulls } = await octokit.pulls.list({ owner, repo });
306+
const { data: currentPulls } = await octokit.rest.pulls.list({
307+
owner,
308+
repo,
309+
});
307310

308311
const currentPull = currentPulls.find((pull) => {
309312
return pull.head.ref === fromBranch && pull.base.ref === toBranch;
@@ -320,7 +323,7 @@ async function run() {
320323
}
321324

322325
if (shouldCreatePullRequest) {
323-
const { data: pullRequest } = await octokit.pulls.create({
326+
const { data: pullRequest } = await octokit.rest.pulls.create({
324327
owner,
325328
repo,
326329
head: fromBranch,
@@ -370,7 +373,7 @@ async function run() {
370373
}
371374

372375
async function hasContentDifference(octokit, fromBranch, toBranch) {
373-
const { data: response } = await octokit.repos.compareCommits({
376+
const { data: response } = await octokit.rest.repos.compareCommits({
374377
owner,
375378
repo,
376379
base: toBranch,

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ async function run() {
2323

2424
const octokit = new github.getOctokit(githubToken);
2525

26-
const { data: currentPulls } = await octokit.pulls.list({ owner, repo });
26+
const { data: currentPulls } = await octokit.rest.pulls.list({
27+
owner,
28+
repo,
29+
});
2730

2831
const currentPull = currentPulls.find((pull) => {
2932
return pull.head.ref === fromBranch && pull.base.ref === toBranch;
@@ -40,7 +43,7 @@ async function run() {
4043
}
4144

4245
if (shouldCreatePullRequest) {
43-
const { data: pullRequest } = await octokit.pulls.create({
46+
const { data: pullRequest } = await octokit.rest.pulls.create({
4447
owner,
4548
repo,
4649
head: fromBranch,
@@ -90,7 +93,7 @@ async function run() {
9093
}
9194

9295
async function hasContentDifference(octokit, fromBranch, toBranch) {
93-
const { data: response } = await octokit.repos.compareCommits({
96+
const { data: response } = await octokit.rest.repos.compareCommits({
9497
owner,
9598
repo,
9699
base: toBranch,

0 commit comments

Comments
 (0)