Skip to content

Commit fb0b195

Browse files
Merge pull request #283 from technote-space/release/next-v3.0.0
release: v3.0.1
2 parents 35e17ea + 99089f8 commit fb0b195

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Helper to filter GitHub Action.",
55
"author": {
66
"name": "Technote",

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/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Command from './command';
33
import ApiHelper from './api-helper';
44
import GitHelper from './git-helper';
55

6+
export * as Types from './types';
67
export * as Utils from './utils';
78
export * as ContextHelper from './context-helper';
89

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {GitHub} from '@actions/github/lib/utils';
2+
3+
export type Octokit = InstanceType<typeof GitHub>;

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)