Change all octokit.pulls calls to octokit.rest.pulls
This commit is contained in:
12
appFn.ts
12
appFn.ts
@@ -7,7 +7,7 @@ import { getPlaylistIdFromUrl } from './getPlaylistIdFromUrl';
|
|||||||
|
|
||||||
type ReviewEvent = 'REQUEST_CHANGES' | 'COMMENT' | 'APPROVE';
|
type ReviewEvent = 'REQUEST_CHANGES' | 'COMMENT' | 'APPROVE';
|
||||||
|
|
||||||
const appFn: ApplicationFunction = (app: Probot, { getRouter }) => {
|
const appFn: ApplicationFunction = (app: Probot) => {
|
||||||
app.on(
|
app.on(
|
||||||
['pull_request.opened', 'pull_request.synchronize'],
|
['pull_request.opened', 'pull_request.synchronize'],
|
||||||
async ({ payload, octokit, log }) => {
|
async ({ payload, octokit, log }) => {
|
||||||
@@ -29,14 +29,14 @@ const appFn: ApplicationFunction = (app: Probot, { getRouter }) => {
|
|||||||
body: string
|
body: string
|
||||||
) => {
|
) => {
|
||||||
if (review_id) {
|
if (review_id) {
|
||||||
await octokit.pulls.updateReview({
|
await octokit.rest.pulls.updateReview({
|
||||||
...workingRepo,
|
...workingRepo,
|
||||||
pull_number,
|
pull_number,
|
||||||
review_id,
|
review_id,
|
||||||
body
|
body
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await octokit.pulls.createReview({
|
await octokit.rest.pulls.createReview({
|
||||||
...workingRepo,
|
...workingRepo,
|
||||||
pull_number,
|
pull_number,
|
||||||
event,
|
event,
|
||||||
@@ -59,7 +59,7 @@ const appFn: ApplicationFunction = (app: Probot, { getRouter }) => {
|
|||||||
if (!isAllowlistedRepo) return;
|
if (!isAllowlistedRepo) return;
|
||||||
|
|
||||||
type PRFileArray = Awaited<
|
type PRFileArray = Awaited<
|
||||||
ReturnType<typeof octokit.pulls.listFiles>
|
ReturnType<typeof octokit.rest.pulls.listFiles>
|
||||||
>['data'];
|
>['data'];
|
||||||
|
|
||||||
const prFiles: PRFileArray = [];
|
const prFiles: PRFileArray = [];
|
||||||
@@ -70,7 +70,7 @@ const appFn: ApplicationFunction = (app: Probot, { getRouter }) => {
|
|||||||
while (isLoadingPages) {
|
while (isLoadingPages) {
|
||||||
await setTimeout(timeToRateLimitReset);
|
await setTimeout(timeToRateLimitReset);
|
||||||
|
|
||||||
const { data, headers } = await octokit.pulls.listFiles({
|
const { data, headers } = await octokit.rest.pulls.listFiles({
|
||||||
...workingRepo,
|
...workingRepo,
|
||||||
pull_number,
|
pull_number,
|
||||||
page
|
page
|
||||||
@@ -285,7 +285,7 @@ const appFn: ApplicationFunction = (app: Probot, { getRouter }) => {
|
|||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join('\n\n');
|
.join('\n\n');
|
||||||
|
|
||||||
const { data: reviews } = await octokit.pulls.listReviews({
|
const { data: reviews } = await octokit.rest.pulls.listReviews({
|
||||||
...workingRepo,
|
...workingRepo,
|
||||||
pull_number
|
pull_number
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user