use @actions/github

This commit is contained in:
Robert Brignull 2020-07-06 16:04:02 +01:00
parent 9da537eb33
commit 0086c2ecdb
199 changed files with 95598 additions and 6141 deletions

View file

@ -1,11 +1,12 @@
import * as core from "@actions/core";
import * as octokit from "@octokit/rest";
import * as github from "@actions/github";
import consoleLogLevel from "console-log-level";
const githubAPIURL = process.env["GITHUB_API_URL"] || "https://api.github.com";
export const client = new octokit.Octokit({
auth: core.getInput("token"),
baseUrl: githubAPIURL,
userAgent: "CodeQL Action",
log: consoleLogLevel({ level: "debug" })
});
export const getApiClient = function() {
return new github.GitHub(
core.getInput('token'),
{
userAgent: "CodeQL Action",
log: consoleLogLevel({ level: "debug" })
});
};