Catch auto_install_packages errors

This commit is contained in:
David Verdeguer
2020-07-23 15:56:03 +02:00
parent 42f07e2f87
commit f65b956f54
3 changed files with 14 additions and 4 deletions
+7 -1
View File
@@ -148,7 +148,13 @@ async function installPythonDeps(codeql) {
return;
}
// Install dependencies
await exec.exec(path.join(scriptsFolder, 'auto_install_packages.py'), [codeql.getDir()]);
try {
await exec.exec(path.join(scriptsFolder, 'auto_install_packages.py'), [codeql.getDir()]);
}
catch (e) {
core.endGroup();
throw new Error('We were unable to install your python dependencies. You can call this action with "setup-python-dependencies: false" to disable this process');
}
core.endGroup();
}
async function run() {
File diff suppressed because one or more lines are too long
+6 -2
View File
@@ -158,8 +158,12 @@ async function installPythonDeps(codeql: CodeQL) {
return;
}
// Install dependencies
await exec.exec(path.join(scriptsFolder, 'auto_install_packages.py'), [codeql.getDir()]);
try {
await exec.exec(path.join(scriptsFolder, 'auto_install_packages.py'), [codeql.getDir()]);
} catch (e) {
core.endGroup();
throw new Error('We were unable to install your python dependencies. You can call this action with "setup-python-dependencies: false" to disable this process');
}
core.endGroup();
}