@dapplion/benchmark
Version:
Ensures that new code does not introduce performance regressions with CI. Tracks:
21 lines (20 loc) • 566 B
JavaScript
import * as github from "@actions/github";
export function isGaRun() {
return Boolean(github.context.eventName);
}
let context = null;
export function getContext() {
const githubToken = process.env.GITHUB_TOKEN;
const repo = github.context.repo;
if (!githubToken)
throw Error("ENV GITHUB_TOKEN not set");
if (!repo)
throw Error("Empty github.context.payload.repository");
if (context === null) {
context = {
repo,
octokit: github.getOctokit(githubToken),
};
}
return context;
}