@@ -13,6 +13,13 @@ REMOTE="https://github.com/${GITHUB_REPOSITORY:-CycloneDX/specification}.git"
1313BUF_IMAGE_VERSION=' 1.50.0'
1414BUF_IMAGE=" bufbuild/buf:$BUF_IMAGE_VERSION "
1515
16+ LOG_FORMAT=' text' # set to 'json' to see details
17+ if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
18+ then
19+ LOG_FORMAT=' github-actions'
20+ fi
21+
22+
1623# # ----
1724
1825
@@ -24,13 +31,6 @@ function prepare () {
2431function schema-lint () {
2532 echo ' > lint schema files' >&2
2633
27- if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
28- then
29- LOG_FORMAT=' github-actions'
30- else
31- LOG_FORMAT=' text'
32- fi
33-
3434 docker run --rm \
3535 --volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
3636 --volume " ${THIS_PATH} /buf_lint.yaml:/workspace/buf.yaml:ro" \
@@ -46,17 +46,11 @@ function schema-lint () {
4646function schema-breaking-version () {
4747 echo ' > test schema for breaking changes against previous version' >&2
4848
49- if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
50- then
51- LOG_FORMAT=' github-actions'
52- else
53- LOG_FORMAT=' text'
54- fi
55-
5649 function compare() {
57- NEW=" bom-${1} .proto"
58- OLD=" bom-${2} .proto"
50+ local NEW=" bom-${1} .proto"
51+ local OLD=" bom-${2} .proto"
5952
53+ local NEW_NP OLD_NP
6054 NEW_NP=" $( mktemp) "
6155 OLD_NP=" $( mktemp) "
6256
@@ -77,8 +71,8 @@ function schema-breaking-version () {
7771 --error-format " $LOG_FORMAT "
7872 }
7973
80- # compare '1.6' '1.5' # <-- possible breaks are acknowledged
81- # compare '1.5' '1.4' # <-- possible breaks are acknowledged
74+ compare ' 1.6' ' 1.5' || echo " possible breaks are acknowledged for this specific version only "
75+ compare ' 1.5' ' 1.4' || echo " possible breaks are acknowledged for this specific version only "
8276 compare ' 1.4' ' 1.3'
8377
8478 echo ' >> OK.' >&2
@@ -87,13 +81,6 @@ function schema-breaking-version () {
8781function schema-breaking-remote () {
8882 echo ' > test schema for breaking changes against remote' >&2
8983
90- if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
91- then
92- LOG_FORMAT=' github-actions'
93- else
94- LOG_FORMAT=' text'
95- fi
96-
9784 docker run --rm \
9885 --volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
9986 --volume " ${THIS_PATH} /buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
@@ -110,10 +97,10 @@ function schema-functional () {
11097 echo ' > test all examples against the respective schema' >&2
11198
11299 function validate() {
113- FILE=" $1 "
114- SCHEMA_VERS=" $2 "
115- SCHEMA_FILE=" bom-${SCHEMA_VERS} .proto"
116- MESSAGE=" cyclonedx.v${SCHEMA_VERS/ ./ _} .Bom"
100+ local FILE=" $1 "
101+ local SCHEMA_VERS=" $2 "
102+ local SCHEMA_FILE=" bom-${SCHEMA_VERS} .proto"
103+ local MESSAGE=" cyclonedx.v${SCHEMA_VERS/ ./ _} .Bom"
117104
118105 echo " >> validate $( realpath --relative-to=" $PWD " " $FILE " ) as ${MESSAGE} of ${SCHEMA_FILE} " >&2
119106
@@ -130,6 +117,7 @@ function schema-functional () {
130117 --to /dev/null
131118 }
132119
120+ local SCHEMA_VERS
133121 shopt -s globstar
134122 for test_res in " $ROOT_PATH " /" $TEST_RES_DIR " /* /valid-* .textproto
135123 do
0 commit comments