mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Merge pull request #3233 from github/mbg/getOptionalEnvVar
Add `getOptionalEnvVar` helper
This commit is contained in:
Generated
+9
-2
@@ -89751,6 +89751,13 @@ function getRequiredEnvParam(paramName) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function getOptionalEnvVar(paramName) {
|
||||
const value = process.env[paramName];
|
||||
if (value?.trim().length === 0) {
|
||||
return void 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var HTTPError = class extends Error {
|
||||
constructor(message, status) {
|
||||
super(message);
|
||||
@@ -95911,8 +95918,8 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
|
||||
return { sarif, analysisKey, environment };
|
||||
}
|
||||
async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) {
|
||||
const outputPath = pathInput || process.env["CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */];
|
||||
if (outputPath !== void 0 && outputPath.trim() !== "") {
|
||||
const outputPath = pathInput || getOptionalEnvVar("CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */);
|
||||
if (outputPath !== void 0) {
|
||||
dumpSarifFile(
|
||||
JSON.stringify(postProcessingResults.sarif),
|
||||
outputPath,
|
||||
|
||||
Generated
+9
-2
@@ -88330,6 +88330,13 @@ function getRequiredEnvParam(paramName) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function getOptionalEnvVar(paramName) {
|
||||
const value = process.env[paramName];
|
||||
if (value?.trim().length === 0) {
|
||||
return void 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var HTTPError = class extends Error {
|
||||
constructor(message, status) {
|
||||
super(message);
|
||||
@@ -92725,8 +92732,8 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
|
||||
return { sarif, analysisKey, environment };
|
||||
}
|
||||
async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) {
|
||||
const outputPath = pathInput || process.env["CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */];
|
||||
if (outputPath !== void 0 && outputPath.trim() !== "") {
|
||||
const outputPath = pathInput || getOptionalEnvVar("CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */);
|
||||
if (outputPath !== void 0) {
|
||||
dumpSarifFile(
|
||||
JSON.stringify(postProcessingResults.sarif),
|
||||
outputPath,
|
||||
|
||||
Generated
+9
-2
@@ -88444,6 +88444,13 @@ function getRequiredEnvParam(paramName) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function getOptionalEnvVar(paramName) {
|
||||
const value = process.env[paramName];
|
||||
if (value?.trim().length === 0) {
|
||||
return void 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var HTTPError = class extends Error {
|
||||
constructor(message, status) {
|
||||
super(message);
|
||||
@@ -93381,8 +93388,8 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
|
||||
return { sarif, analysisKey, environment };
|
||||
}
|
||||
async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProcessingResults) {
|
||||
const outputPath = pathInput || process.env["CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */];
|
||||
if (outputPath !== void 0 && outputPath.trim() !== "") {
|
||||
const outputPath = pathInput || getOptionalEnvVar("CODEQL_ACTION_SARIF_DUMP_DIR" /* SARIF_DUMP_DIR */);
|
||||
if (outputPath !== void 0) {
|
||||
dumpSarifFile(
|
||||
JSON.stringify(postProcessingResults.sarif),
|
||||
outputPath,
|
||||
|
||||
Reference in New Issue
Block a user