mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 12:10:20 +08:00
Turn invalid helpUri attribute into a warning
This commit is contained in:
@@ -449,11 +449,20 @@ export function validateSarifFileSchema(sarifFilePath: string, logger: Logger) {
|
||||
const result = new jsonschema.Validator().validate(sarif, schema);
|
||||
// Filter errors related to invalid URIs in the artifactLocation field as this
|
||||
// is a breaking change. See https://github.com/github/codeql-action/issues/1703
|
||||
const errors = (result.errors || []).filter(
|
||||
(err) => err.argument !== "uri-reference",
|
||||
const warningAttributes = ["uri-reference", "uri"];
|
||||
const errors = (result.errors ?? []).filter(
|
||||
(err) =>
|
||||
!(
|
||||
err.name === "format" &&
|
||||
typeof err.argument === "string" &&
|
||||
warningAttributes.includes(err.argument)
|
||||
),
|
||||
);
|
||||
const warnings = (result.errors || []).filter(
|
||||
(err) => err.argument === "uri-reference",
|
||||
const warnings = (result.errors ?? []).filter(
|
||||
(err) =>
|
||||
err.name === "format" &&
|
||||
typeof err.argument === "string" &&
|
||||
warningAttributes.includes(err.argument),
|
||||
);
|
||||
|
||||
for (const warning of warnings) {
|
||||
|
||||
Reference in New Issue
Block a user