Request meta endpoint at the start of execution

This commit is contained in:
Robert 2020-11-26 17:54:34 +00:00
parent 8d18e347a7
commit 81a21bfa1e
46 changed files with 348 additions and 259 deletions

9
lib/runner.js generated
View file

@ -107,6 +107,10 @@ program
auth: cmd.githubAuth,
url: util_1.parseGithubUrl(cmd.githubUrl),
};
const ghesVersion = await util_1.getGHESVersion(apiDetails);
if (ghesVersion !== undefined) {
util_1.checkGHESVersionInRange(ghesVersion, "runner", logger);
}
let codeql;
if (cmd.codeqlPath !== undefined) {
codeql = codeql_1.getCodeQL(cmd.codeqlPath);
@ -114,7 +118,7 @@ program
else {
codeql = (await init_1.initCodeQL(undefined, apiDetails, tempDir, toolsDir, "runner", logger)).codeql;
}
const config = await init_1.initConfig(cmd.languages, cmd.queries, cmd.configFile, repository_1.parseRepositoryNwo(cmd.repository), tempDir, toolsDir, codeql, cmd.checkoutPath || process.cwd(), apiDetails, "runner", logger);
const config = await init_1.initConfig(cmd.languages, cmd.queries, cmd.configFile, repository_1.parseRepositoryNwo(cmd.repository), tempDir, toolsDir, codeql, cmd.checkoutPath || process.cwd(), ghesVersion, apiDetails, logger);
const tracerConfig = await init_1.runInit(codeql, config);
if (tracerConfig === undefined) {
return;
@ -253,7 +257,8 @@ program
url: util_1.parseGithubUrl(cmd.githubUrl),
};
try {
await upload_lib.upload(cmd.sarifFile, repository_1.parseRepositoryNwo(cmd.repository), cmd.commit, parseRef(cmd.ref), undefined, undefined, undefined, cmd.checkoutPath || process.cwd(), undefined, apiDetails, "runner", logger);
const ghesVersion = await util_1.getGHESVersion(apiDetails);
await upload_lib.upload(cmd.sarifFile, repository_1.parseRepositoryNwo(cmd.repository), cmd.commit, parseRef(cmd.ref), undefined, undefined, undefined, cmd.checkoutPath || process.cwd(), undefined, ghesVersion, apiDetails, "runner", logger);
}
catch (e) {
logger.error("Upload failed");