Use getOctokit(...) when getting the GitHub API client.

This commit is contained in:
Chris Gavin 2020-09-21 15:21:05 +01:00
parent 9ed519fa12
commit cc0eb452c7
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
3 changed files with 5 additions and 7 deletions

5
lib/api-client.js generated
View file

@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const github = __importStar(require("@actions/github/lib/utils"));
const github = __importStar(require("@actions/github"));
const console_log_level_1 = __importDefault(require("console-log-level"));
const path = __importStar(require("path"));
const actions_util_1 = require("./actions-util");
@ -19,8 +19,7 @@ exports.getApiClient = function (githubAuth, githubUrl, allowLocalRun = false) {
if (util_1.isLocalRun() && !allowLocalRun) {
throw new Error("Invalid API call in local run");
}
return new github.GitHub({
auth: githubAuth,
return github.getOctokit(githubAuth, {
baseUrl: getApiUrl(githubUrl),
userAgent: "CodeQL Action",
log: console_log_level_1.default({ level: "debug" }),