diff --git a/__tests__/github.test.ts b/__tests__/github.test.ts index 42e010f..b98b6f7 100644 --- a/__tests__/github.test.ts +++ b/__tests__/github.test.ts @@ -18,13 +18,14 @@ import {describe, expect, jest, it, beforeEach, afterEach} from '@jest/globals'; import * as fs from 'fs'; import * as path from 'path'; -import {GitHub, GitHubRepo} from '../src/github'; +import {GitHub} from '../src/github'; +import {GitHubRepo} from '../src/types/github'; beforeEach(() => { jest.clearAllMocks(); }); -import * as repoFixture from './fixtures/repo.json'; +import repoFixture from './fixtures/repo.json'; jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise => { return >(repoFixture as unknown); }); diff --git a/src/github.ts b/src/github.ts index e2098c7..232f6f4 100644 --- a/src/github.ts +++ b/src/github.ts @@ -16,15 +16,10 @@ import {GitHub as Octokit} from '@actions/github/lib/utils'; import * as github from '@actions/github'; -import {components as OctoOpenApiTypes} from '@octokit/openapi-types'; -import jwt_decode, {JwtPayload} from 'jwt-decode'; import {Context} from '@actions/github/lib/context'; +import jwt_decode from 'jwt-decode'; -export type GitHubRepo = OctoOpenApiTypes['schemas']['repository']; - -export interface GitHubActionsRuntimeToken extends JwtPayload { - ac?: string; -} +import {GitHubActionsRuntimeToken, GitHubRepo} from './types/github'; export interface GitHubOpts { token?: string; diff --git a/src/types/github.ts b/src/types/github.ts index f561631..833a405 100644 --- a/src/types/github.ts +++ b/src/types/github.ts @@ -14,9 +14,18 @@ * limitations under the License. */ +import {components as OctoOpenApiTypes} from '@octokit/openapi-types'; +import {JwtPayload} from 'jwt-decode'; + export interface GitHubRelease { id: number; tag_name: string; html_url: string; assets: Array; } + +export type GitHubRepo = OctoOpenApiTypes['schemas']['repository']; + +export interface GitHubActionsRuntimeToken extends JwtPayload { + ac?: string; +}