Improve logging for combined SARIF debug artifact

This commit is contained in:
Henry Mercer 2024-09-17 11:15:08 +02:00
parent d0a3cf2152
commit 6e24973d7a
9 changed files with 72 additions and 51 deletions

View file

@ -7,14 +7,19 @@ import * as core from "@actions/core";
import * as debugArtifacts from "./debug-artifacts";
import { EnvVar } from "./environment";
import { getActionsLogger, withGroup } from "./logging";
import { getErrorMessage } from "./util";
async function runWrapper() {
try {
const logger = getActionsLogger();
// Upload SARIF artifacts if we determine that this is a first-party analysis run.
// For third-party runs, this artifact will be uploaded in the `upload-sarif-post` step.
if (process.env[EnvVar.INIT_ACTION_HAS_RUN] === "true") {
await debugArtifacts.uploadCombinedSarifArtifacts();
await withGroup("Uploading combined SARIF debug artifact", () =>
debugArtifacts.uploadCombinedSarifArtifacts(logger),
);
}
} catch (error) {
core.setFailed(