Merge pull request #32 from github/codeql-download-failure
provide a better error when codeql fails to download
This commit is contained in:
commit
27cc8b23fe
2 changed files with 28 additions and 16 deletions
6
lib/setup-tools.js
generated
6
lib/setup-tools.js
generated
|
|
@ -37,6 +37,7 @@ exports.CodeQLSetup = CodeQLSetup;
|
||||||
async function setupCodeQL() {
|
async function setupCodeQL() {
|
||||||
const version = '1.0.0';
|
const version = '1.0.0';
|
||||||
const codeqlURL = core.getInput('tools', { required: true });
|
const codeqlURL = core.getInput('tools', { required: true });
|
||||||
|
try {
|
||||||
let codeqlFolder = toolcache.find('CodeQL', version);
|
let codeqlFolder = toolcache.find('CodeQL', version);
|
||||||
if (codeqlFolder) {
|
if (codeqlFolder) {
|
||||||
core.debug(`CodeQL found in cache ${codeqlFolder}`);
|
core.debug(`CodeQL found in cache ${codeqlFolder}`);
|
||||||
|
|
@ -47,5 +48,10 @@ async function setupCodeQL() {
|
||||||
codeqlFolder = await toolcache.cacheDir(codeqlExtracted, 'CodeQL', version);
|
codeqlFolder = await toolcache.cacheDir(codeqlExtracted, 'CodeQL', version);
|
||||||
}
|
}
|
||||||
return new CodeQLSetup(path.join(codeqlFolder, 'codeql'));
|
return new CodeQLSetup(path.join(codeqlFolder, 'codeql'));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
core.error(e);
|
||||||
|
throw new Error("Unable to download and extract CodeQL CLI");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.setupCodeQL = setupCodeQL;
|
exports.setupCodeQL = setupCodeQL;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ export async function setupCodeQL(): Promise<CodeQLSetup> {
|
||||||
const version = '1.0.0';
|
const version = '1.0.0';
|
||||||
const codeqlURL = core.getInput('tools', { required: true });
|
const codeqlURL = core.getInput('tools', { required: true });
|
||||||
|
|
||||||
|
try {
|
||||||
let codeqlFolder = toolcache.find('CodeQL', version);
|
let codeqlFolder = toolcache.find('CodeQL', version);
|
||||||
if (codeqlFolder) {
|
if (codeqlFolder) {
|
||||||
core.debug(`CodeQL found in cache ${codeqlFolder}`);
|
core.debug(`CodeQL found in cache ${codeqlFolder}`);
|
||||||
|
|
@ -41,4 +42,9 @@ export async function setupCodeQL(): Promise<CodeQLSetup> {
|
||||||
codeqlFolder = await toolcache.cacheDir(codeqlExtracted, 'CodeQL', version);
|
codeqlFolder = await toolcache.cacheDir(codeqlExtracted, 'CodeQL', version);
|
||||||
}
|
}
|
||||||
return new CodeQLSetup(path.join(codeqlFolder, 'codeql'));
|
return new CodeQLSetup(path.join(codeqlFolder, 'codeql'));
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
core.error(e);
|
||||||
|
throw new Error("Unable to download and extract CodeQL CLI");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue