mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 08:48:46 +00:00
Merge pull request #3409 from github/mbg/start-proxy/make-unique-artifact
Ensure that proxy log artifacts have unique names
This commit is contained in:
Generated
+26
-17
@@ -125716,10 +125716,26 @@ async function uploadCombinedSarifArtifacts(logger, gitHubVariant, codeQlVersion
|
||||
});
|
||||
}
|
||||
}
|
||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
|
||||
if (toUpload.length === 0) {
|
||||
return "no-artifacts-to-upload";
|
||||
function getArtifactSuffix(matrix) {
|
||||
let suffix = "";
|
||||
if (matrix) {
|
||||
try {
|
||||
const matrixObject = JSON.parse(matrix);
|
||||
if (matrixObject !== null && typeof matrixObject === "object") {
|
||||
for (const matrixKey of Object.keys(matrixObject).sort())
|
||||
suffix += `-${matrixObject[matrixKey]}`;
|
||||
} else {
|
||||
core12.warning("User-specified `matrix` input is not an object.");
|
||||
}
|
||||
} catch {
|
||||
core12.warning(
|
||||
"Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
|
||||
);
|
||||
}
|
||||
}
|
||||
return suffix;
|
||||
}
|
||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
|
||||
const uploadSupported = isSafeArtifactUpload(codeQlVersion);
|
||||
if (!uploadSupported) {
|
||||
core12.info(
|
||||
@@ -125727,24 +125743,17 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
|
||||
);
|
||||
return "upload-not-supported";
|
||||
}
|
||||
return uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant);
|
||||
}
|
||||
async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant) {
|
||||
if (toUpload.length === 0) {
|
||||
return "no-artifacts-to-upload";
|
||||
}
|
||||
if (isInTestMode()) {
|
||||
await scanArtifactsForTokens(toUpload, logger);
|
||||
core12.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true");
|
||||
}
|
||||
let suffix = "";
|
||||
const matrix = getOptionalInput("matrix");
|
||||
if (matrix) {
|
||||
try {
|
||||
for (const [, matrixVal] of Object.entries(
|
||||
JSON.parse(matrix)
|
||||
).sort())
|
||||
suffix += `-${matrixVal}`;
|
||||
} catch {
|
||||
core12.info(
|
||||
"Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
|
||||
);
|
||||
}
|
||||
}
|
||||
const suffix = getArtifactSuffix(getOptionalInput("matrix"));
|
||||
const artifactUploader = await getArtifactUploaderClient(logger, ghVariant);
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(
|
||||
|
||||
Generated
+26
-17
@@ -130453,10 +130453,26 @@ async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger, codeQ
|
||||
);
|
||||
}
|
||||
}
|
||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
|
||||
if (toUpload.length === 0) {
|
||||
return "no-artifacts-to-upload";
|
||||
function getArtifactSuffix(matrix) {
|
||||
let suffix = "";
|
||||
if (matrix) {
|
||||
try {
|
||||
const matrixObject = JSON.parse(matrix);
|
||||
if (matrixObject !== null && typeof matrixObject === "object") {
|
||||
for (const matrixKey of Object.keys(matrixObject).sort())
|
||||
suffix += `-${matrixObject[matrixKey]}`;
|
||||
} else {
|
||||
core12.warning("User-specified `matrix` input is not an object.");
|
||||
}
|
||||
} catch {
|
||||
core12.warning(
|
||||
"Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
|
||||
);
|
||||
}
|
||||
}
|
||||
return suffix;
|
||||
}
|
||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
|
||||
const uploadSupported = isSafeArtifactUpload(codeQlVersion);
|
||||
if (!uploadSupported) {
|
||||
core12.info(
|
||||
@@ -130464,24 +130480,17 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
|
||||
);
|
||||
return "upload-not-supported";
|
||||
}
|
||||
return uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant);
|
||||
}
|
||||
async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant) {
|
||||
if (toUpload.length === 0) {
|
||||
return "no-artifacts-to-upload";
|
||||
}
|
||||
if (isInTestMode()) {
|
||||
await scanArtifactsForTokens(toUpload, logger);
|
||||
core12.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true");
|
||||
}
|
||||
let suffix = "";
|
||||
const matrix = getOptionalInput("matrix");
|
||||
if (matrix) {
|
||||
try {
|
||||
for (const [, matrixVal] of Object.entries(
|
||||
JSON.parse(matrix)
|
||||
).sort())
|
||||
suffix += `-${matrixVal}`;
|
||||
} catch {
|
||||
core12.info(
|
||||
"Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
|
||||
);
|
||||
}
|
||||
}
|
||||
const suffix = getArtifactSuffix(getOptionalInput("matrix"));
|
||||
const artifactUploader = await getArtifactUploaderClient(logger, ghVariant);
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(
|
||||
|
||||
Generated
+1542
-1256
File diff suppressed because it is too large
Load Diff
Generated
+26
-17
@@ -124642,10 +124642,26 @@ async function uploadCombinedSarifArtifacts(logger, gitHubVariant, codeQlVersion
|
||||
});
|
||||
}
|
||||
}
|
||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
|
||||
if (toUpload.length === 0) {
|
||||
return "no-artifacts-to-upload";
|
||||
function getArtifactSuffix(matrix) {
|
||||
let suffix = "";
|
||||
if (matrix) {
|
||||
try {
|
||||
const matrixObject = JSON.parse(matrix);
|
||||
if (matrixObject !== null && typeof matrixObject === "object") {
|
||||
for (const matrixKey of Object.keys(matrixObject).sort())
|
||||
suffix += `-${matrixObject[matrixKey]}`;
|
||||
} else {
|
||||
core12.warning("User-specified `matrix` input is not an object.");
|
||||
}
|
||||
} catch {
|
||||
core12.warning(
|
||||
"Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
|
||||
);
|
||||
}
|
||||
}
|
||||
return suffix;
|
||||
}
|
||||
async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
|
||||
const uploadSupported = isSafeArtifactUpload(codeQlVersion);
|
||||
if (!uploadSupported) {
|
||||
core12.info(
|
||||
@@ -124653,24 +124669,17 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
|
||||
);
|
||||
return "upload-not-supported";
|
||||
}
|
||||
return uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant);
|
||||
}
|
||||
async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVariant) {
|
||||
if (toUpload.length === 0) {
|
||||
return "no-artifacts-to-upload";
|
||||
}
|
||||
if (isInTestMode()) {
|
||||
await scanArtifactsForTokens(toUpload, logger);
|
||||
core12.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true");
|
||||
}
|
||||
let suffix = "";
|
||||
const matrix = getOptionalInput("matrix");
|
||||
if (matrix) {
|
||||
try {
|
||||
for (const [, matrixVal] of Object.entries(
|
||||
JSON.parse(matrix)
|
||||
).sort())
|
||||
suffix += `-${matrixVal}`;
|
||||
} catch {
|
||||
core12.info(
|
||||
"Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input."
|
||||
);
|
||||
}
|
||||
}
|
||||
const suffix = getArtifactSuffix(getOptionalInput("matrix"));
|
||||
const artifactUploader = await getArtifactUploaderClient(logger, ghVariant);
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(
|
||||
|
||||
Reference in New Issue
Block a user