Turn invalid helpUri attribute into a warning
This commit is contained in:
parent
c101242d73
commit
642bbfc83a
7 changed files with 59 additions and 32 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue