Always upload DB when in debug mode

This commit is contained in:
Edoardo Pirovano 2021-12-30 16:47:21 +00:00
parent e5d84de18b
commit 00d4d60204
No known key found for this signature in database
GPG key ID: 047556B5D93FFE28
3 changed files with 29 additions and 16 deletions

View file

@ -207,14 +207,6 @@ async function run() {
getActionsLogger()
);
}
if (config.debugMode) {
// Upload the database bundles as an Actions artifact for debugging
const toUpload: string[] = [];
for (const language of config.languages)
toUpload.push(await bundleDb(config, language, codeql));
await uploadDebugArtifacts(toUpload, config.dbLocation);
}
} catch (origError) {
const error =
origError instanceof Error ? origError : new Error(String(origError));
@ -230,6 +222,21 @@ async function run() {
return;
} finally {
if (config !== undefined && config.debugMode) {
try {
// Upload the database bundles as an Actions artifact for debugging
const toUpload: string[] = [];
for (const language of config.languages) {
toUpload.push(
await bundleDb(config, language, await getCodeQL(config.codeQLCmd))
);
}
await uploadDebugArtifacts(toUpload, config.dbLocation);
} catch (error) {
console.log(`Failed to upload database debug bundles: ${error}`);
}
}
if (core.isDebug() && config !== undefined) {
core.info("Debug mode is on. Printing CodeQL debug logs...");
for (const language of config.languages) {