Skip to content

Commit e1f5149

Browse files
fix: type errors
1 parent 9afc473 commit e1f5149

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/api-helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import fs from 'fs';
22
import path from 'path';
33
import {Context} from '@actions/github/lib/context';
44
import {Octokit} from '@octokit/rest';
5+
import {Octokit as OctokitCore} from '@octokit/core';
56
import {exportVariable} from '@actions/core';
67
import {Logger} from './index';
78
import {getRefForUpdate, isPrRef, getBranch, trimRef, versionCompare, generateNewPatchVersion, generateNewMajorVersion, generateNewMinorVersion} from './utils';
@@ -58,7 +59,7 @@ export default class ApiHelper {
5859
* @param {boolean|undefined} options.suppressBPError suppress branch protection error?
5960
*/
6061
constructor(
61-
private readonly octokit: Octokit,
62+
private readonly octokit: OctokitCore,
6263
private readonly context: Context,
6364
private readonly logger?: Logger,
6465
options?: { branch?: string; sender?: string; refForUpdate?: string; suppressBPError?: boolean },

src/utils.ts

Lines changed: 3 additions & 3 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';
4+
import {GitHub} from '@actions/github/lib/utils';
55
import {Context} from '@actions/github/lib/context';
6-
import {Octokit} from '@octokit/rest';
6+
import {getOctokit as getOctokitInstance} from '@actions/github';
77

88
const getRef = (ref: string | Context): string => typeof ref === 'string' ? ref : ref.ref;
99

@@ -88,7 +88,7 @@ export const getRefspec = (ref: string | Context, origin = 'origin'): string =>
8888

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

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

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

0 commit comments

Comments
 (0)