2
0
Fork 0
mirror of https://code.forgejo.org/docker/metadata-action.git synced 2025-08-27 00:10:55 +00:00

Initial commit

This commit is contained in:
CrazyMax 2020-10-25 02:25:23 +01:00
commit 90ec551e12
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
42 changed files with 14168 additions and 0 deletions

18
src/github.ts Normal file
View file

@ -0,0 +1,18 @@
import * as github from '@actions/github';
import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
export function context(): Context {
return github.context;
}
export async function repo(token: string): Promise<ReposGetResponseData> {
const octokit = github.getOctokit(token);
const repo = await octokit.repos.get({
...github.context.repo
});
if (!repo?.data) {
throw new Error('Cannot get GitHub repository');
}
return repo.data;
}