mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 03:16:09 +08:00
github: move types
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
dea2294b93
commit
fe8b21ecf5
@ -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<GitHubRepo> => {
|
||||
return <Promise<GitHubRepo>>(repoFixture as unknown);
|
||||
});
|
||||
|
@ -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;
|
||||
|
@ -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<string>;
|
||||
}
|
||||
|
||||
export type GitHubRepo = OctoOpenApiTypes['schemas']['repository'];
|
||||
|
||||
export interface GitHubActionsRuntimeToken extends JwtPayload {
|
||||
ac?: string;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user