Skip to content

Commit 82b82e5

Browse files
committed
Only upload combined SARIF files when env var is set
1 parent 3c4b8bc commit 82b82e5

6 files changed

+17
-4
lines changed

lib/analyze-action-post.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action-post-helper.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action-post-helper.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze-action-post.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ import * as core from "@actions/core";
77

88
import * as analyzeActionPostHelper from "./analyze-action-post-helper";
99
import * as debugArtifacts from "./debug-artifacts";
10+
import * as uploadSarifActionPostHelper from "./upload-sarif-action-post-helper";
1011
import { wrapError } from "./util";
1112

1213
async function runWrapper() {
1314
try {
1415
await analyzeActionPostHelper.run(debugArtifacts.uploadSarifDebugArtifact);
16+
17+
// Also run the upload-sarif post action since we're potentially running
18+
// the same steps in the analyze action.
19+
await uploadSarifActionPostHelper.run(debugArtifacts.uploadDebugArtifacts);
1520
} catch (error) {
1621
core.setFailed(
1722
`analyze post-action step failed: ${wrapError(error).message}`,

src/upload-sarif-action-post-helper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export async function run(
1515
const tempDir = actionsUtil.getTemporaryDirectory();
1616

1717
// Upload Actions SARIF artifacts for debugging
18-
if (core.isDebug()) {
18+
if (
19+
core.isDebug() &&
20+
process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true"
21+
) {
1922
core.info(
2023
"Debug mode is on. Uploading available combined SARIF files as Actions debugging artifact...",
2124
);

0 commit comments

Comments
 (0)