mirror of
https://gitea.com/docker/metadata-action.git
synced 2024-11-25 21:49:33 +01:00
28d7c8bbcd
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
18 lines
548 B
TypeScript
18 lines
548 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);
|
|
}
|