Skip to content

Commit

Permalink
Merge pull request #860 from edoardopirovano/always-upload-db
Browse files Browse the repository at this point in the history
Always upload DB when in debug mode
  • Loading branch information
edoardopirovano committed Jan 4, 2022
2 parents e5d84de + 00d4d60 commit 9763bdd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
20 changes: 13 additions & 7 deletions lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 15 additions & 8 deletions src/analyze-action.ts
Expand Up @@ -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));
Expand All @@ -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) {
Expand Down

0 comments on commit 9763bdd

Please sign in to comment.