Use new API client

From https://github.com/github/codeql-action/pull/82
This commit is contained in:
Sam Partington 2020-06-26 13:51:14 +01:00
parent 9566d8c220
commit f8c87948ab
6 changed files with 25 additions and 81 deletions

View file

@ -1,11 +1,10 @@
import * as core from '@actions/core';
import * as io from '@actions/io';
import * as octokit from '@octokit/rest';
import consoleLogLevel from 'console-log-level';
import * as fs from 'fs';
import * as yaml from 'js-yaml';
import * as path from 'path';
import * as api from './api-client';
import * as util from './util';
const NAME_PROPERTY = 'name';
@ -287,12 +286,7 @@ async function getRemoteConfig(configFile: string): Promise<any> {
throw new Error(getConfigFileRepoFormatInvalid(configFile));
}
let ok = new octokit.Octokit({
auth: core.getInput('token'),
userAgent: "CodeQL Action",
log: consoleLogLevel({ level: "debug" })
});
const response = await ok.repos.getContents({
const response = await api.client.repos.getContents({
owner: pieces.groups.owner,
repo: pieces.groups.repo,
path: pieces.groups.path,