Skip to content

Commit c345d47

Browse files
committed
twoliter: add check-advisories task to lint BRSAs
Lint BRSAs for non-ASCII characters that may be included in advisory information in a new task, check-advisories. Add this to the list in the meta task "check" Signed-off-by: Gavin Inglis <[email protected]>
1 parent 2519e56 commit c345d47

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

twoliter/embedded/Makefile.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ done
416416
[tasks.check]
417417
dependencies = [
418418
"check-cargo-version",
419+
"check-advisories",
419420
"unit-tests",
420421
"check-fmt",
421422
"check-lints",
@@ -540,6 +541,21 @@ fi
540541
'''
541542
]
542543

544+
# Task to check for non-ASCII characters in Bottlerocket Security Advisories.
545+
[tasks.check-advisories]
546+
script_runner = "bash"
547+
script = [
548+
'''
549+
if find advisories -name '*.toml' -type f >/dev/null 2>&1 ; then
550+
export LC_ALL=C
551+
if grep --include '*.toml' -R -l -P ['\x80'-'\xFF'] advisories ; then
552+
echo "error: found non-ASCII characters in advisories" >&2
553+
exit 1
554+
fi
555+
fi
556+
'''
557+
]
558+
543559
[tasks.check-golangci-lint]
544560
script = [
545561
'''

0 commit comments

Comments
 (0)