Skip to content

Commit 66734e4

Browse files
chore: use new type
1 parent d53d987 commit 66734e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/api-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fs from 'fs';
22
import path from 'path';
33
import {Context} from '@actions/github/lib/context';
4-
import {GitHub} from '@actions/github/lib/utils';
54
import {PaginateInterface} from '@octokit/plugin-paginate-rest';
65
import {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types';
76
import {
@@ -20,6 +19,7 @@ import {exportVariable} from '@actions/core';
2019
import {Logger} from './index';
2120
import {getRefForUpdate, isPrRef, getBranch, trimRef, versionCompare, generateNewPatchVersion, generateNewMajorVersion, generateNewMinorVersion} from './utils';
2221
import {getSender} from './context-helper';
22+
import {Octokit} from './types';
2323

2424
type PullsUpdateParams = {
2525
body?: string;
@@ -72,7 +72,7 @@ export default class ApiHelper {
7272
* @param {boolean|undefined} options.suppressBPError suppress branch protection error?
7373
*/
7474
constructor(
75-
private readonly octokit: InstanceType<typeof GitHub>,
75+
private readonly octokit: Octokit,
7676
private readonly context: Context,
7777
private readonly logger?: Logger,
7878
options?: { branch?: string; sender?: string; refForUpdate?: string; suppressBPError?: boolean },

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import fs from 'fs';
22
import path from 'path';
33
import {getInput} from '@actions/core' ;
4-
import {GitHub} from '@actions/github/lib/utils';
54
import {Context} from '@actions/github/lib/context';
65
import {getOctokit as getOctokitInstance} from '@actions/github';
6+
import {Octokit} from './types';
77

88
type RefObject = { ref: string }
99
const getRef = (ref: string | RefObject): string => typeof ref === 'string' ? ref : ref.ref;
@@ -89,7 +89,7 @@ export const getRefspec = (ref: string | RefObject, origin = 'origin'): string =
8989

9090
export const getAccessToken = (required: boolean): string => getInput('GITHUB_TOKEN', {required});
9191

92-
export const getOctokit = (token?: string): InstanceType<typeof GitHub> => getOctokitInstance(token ?? getAccessToken(true), {});
92+
export const getOctokit = (token?: string): Octokit => getOctokitInstance(token ?? getAccessToken(true), {});
9393

9494
export const getActor = (): string => process.env.GITHUB_ACTOR || '';
9595

0 commit comments

Comments
 (0)