Skip to content

Commit 78dbf90

Browse files
committed
Use getOptionalEnvVar in writePostProcessedFiles
1 parent ad35676 commit 78dbf90

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

lib/analyze-action.js

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

lib/upload-lib.js

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

lib/upload-sarif-action.js

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

src/upload-lib.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,11 @@ export async function writePostProcessedFiles(
774774
postProcessingResults: PostProcessingResults,
775775
) {
776776
// If there's an explicit input, use that. Otherwise, use the value from the environment variable.
777-
const outputPath = pathInput || process.env[EnvVar.SARIF_DUMP_DIR];
777+
const outputPath: string | undefined =
778+
pathInput || util.getOptionalEnvVar[EnvVar.SARIF_DUMP_DIR];
778779

779780
// If we have a non-empty output path, write the SARIF file to it.
780-
if (outputPath !== undefined && outputPath.trim() !== "") {
781+
if (outputPath !== undefined) {
781782
dumpSarifFile(
782783
JSON.stringify(postProcessingResults.sarif),
783784
outputPath,

0 commit comments

Comments
 (0)