Use a single Octokit client for everything rather than a bunch of Octokits and an HTTP client.
This commit is contained in:
parent
bc21c8f6f3
commit
74c48f71fa
9 changed files with 92 additions and 91 deletions
11
src/api-client.ts
Normal file
11
src/api-client.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import * as core from "@actions/core";
|
||||
import * as octokit from "@octokit/rest";
|
||||
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" })
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue