Skip to content

Commit

Permalink
Add more info messages to user, rename log printing function
Browse files Browse the repository at this point in the history
  • Loading branch information
Angela P Wen committed Aug 2, 2022
1 parent eeee462 commit a758ec5
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions lib/analyze-action-post.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-post.js.map

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

6 changes: 3 additions & 3 deletions lib/debug-artifacts.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/debug-artifacts.js.map

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

7 changes: 4 additions & 3 deletions lib/init-action-post.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/init-action-post.js.map

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

3 changes: 3 additions & 0 deletions src/analyze-action-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ async function run(uploadSarifDebugArtifact: Function) {

// Upload Actions SARIF artifacts for debugging
if (config?.debugMode) {
core.info(
"Debug mode is on. Uploading available SARIF files as Actions debugging artifact..."
);
const outputDir = actionsUtil.getRequiredInput("output");
await uploadSarifDebugArtifact(config, outputDir);
}
Expand Down
2 changes: 1 addition & 1 deletion src/debug-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function uploadSarifDebugArtifact(
await uploadDebugArtifacts(toUpload, outputDir, config.debugArtifactName);
}

export async function uploadFinalLogsDebugArtifact(config: Config) {
export async function printDebugLogs(config: Config) {
core.info("Debug mode is on. Printing CodeQL debug logs...");
for (const language of config.languages) {
const databaseDirectory = getCodeQLDatabasePath(config, language);
Expand Down
10 changes: 7 additions & 3 deletions src/init-action-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getActionsLogger } from "./logging";
async function run(
uploadDatabaseBundleDebugArtifact: Function,
uploadLogsDebugArtifact: Function,
uploadFinalLogsDebugArtifact: Function
printDebugLogs: Function
) {
const logger = getActionsLogger();

Expand All @@ -27,9 +27,13 @@ async function run(

// Upload appropriate Actions artifacts for debugging
if (config?.debugMode) {
core.info(
"Debug mode is on. Uploading available database bundles and logs as Actions debugging artifacts..."
);
await uploadDatabaseBundleDebugArtifact(config, logger);
await uploadLogsDebugArtifact(config);
await uploadFinalLogsDebugArtifact(config);

await printDebugLogs(config);
}
}

Expand All @@ -38,7 +42,7 @@ async function runWrapper() {
await run(
debugArtifacts.uploadDatabaseBundleDebugArtifact,
debugArtifacts.uploadLogsDebugArtifact,
debugArtifacts.uploadFinalLogsDebugArtifact
debugArtifacts.printDebugLogs
);
} catch (error) {
core.setFailed(`init action cleanup failed: ${error}`);
Expand Down

0 comments on commit a758ec5

Please sign in to comment.