mirror of
https://github.com/github/codeql-action.git
synced 2026-04-03 02:02:17 +00:00
Sanitise artifact name
This commit is contained in:
2
lib/init-action-post.js
generated
2
lib/init-action-post.js
generated
@@ -169882,7 +169882,7 @@ async function maybeUploadFailedSarifArtifact(config, features, logger) {
|
||||
const gitHubVersion = await getGitHubVersion();
|
||||
const client = await getArtifactUploaderClient(logger, gitHubVersion.type);
|
||||
const suffix = getArtifactSuffix(getOptionalInput("matrix"));
|
||||
const name = `sarif-artifact-${suffix}`;
|
||||
const name = sanitizeArtifactName(`sarif-artifact-${suffix}`);
|
||||
await client.uploadArtifact(
|
||||
name,
|
||||
[import_path3.default.normalize(failedSarif.sarifFile)],
|
||||
|
||||
@@ -672,7 +672,9 @@ test("tryUploadSarifIfRunFailed - uploads as artifact for risk assessments", asy
|
||||
logger,
|
||||
);
|
||||
|
||||
const expectedName = `sarif-artifact-${debugArtifacts.getArtifactSuffix(matrix)}`;
|
||||
const expectedName = debugArtifacts.sanitizeArtifactName(
|
||||
`sarif-artifact-${debugArtifacts.getArtifactSuffix(matrix)}`,
|
||||
);
|
||||
t.is(result.upload_failed_run_skipped_because, undefined);
|
||||
t.is(result.upload_failed_run_error, undefined);
|
||||
t.is(result.sarifID, expectedName);
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
import {
|
||||
getArtifactSuffix,
|
||||
getArtifactUploaderClient,
|
||||
sanitizeArtifactName,
|
||||
} from "./debug-artifacts";
|
||||
import * as dependencyCaching from "./dependency-caching";
|
||||
import { EnvVar } from "./environment";
|
||||
@@ -233,7 +234,7 @@ async function maybeUploadFailedSarifArtifact(
|
||||
const client = await getArtifactUploaderClient(logger, gitHubVersion.type);
|
||||
|
||||
const suffix = getArtifactSuffix(actionsUtil.getOptionalInput("matrix"));
|
||||
const name = `sarif-artifact-${suffix}`;
|
||||
const name = sanitizeArtifactName(`sarif-artifact-${suffix}`);
|
||||
await client.uploadArtifact(
|
||||
name,
|
||||
[path.normalize(failedSarif.sarifFile)],
|
||||
|
||||
Reference in New Issue
Block a user