docker-metadata-action/src/github.ts
CrazyMax 5f62bc0532
dev: update fixtures
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-19 13:18:19 +02:00

17 lines
536 B
TypeScript

import * as github from '@actions/github';
import {Context} from '@actions/github/lib/context';
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
export type ReposGetResponseData = OctoOpenApiTypes['schemas']['repository'];
export function context(): Context {
return github.context;
}
export async function repo(token: string): Promise<ReposGetResponseData> {
return github
.getOctokit(token)
.rest.repos.get({...github.context.repo})
.then(response => response.data as ReposGetResponseData);
}