-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an SBOM URI field to artifact events (#171)
* Add an SBOM URI field to artifact events Artifact packaged and/or published events may include a link to a published SBOM. Since there is no default storage location for such SBOM documents, CDEvents may help linking the artifact with its SBOM by including a link to the SBOM in the artifact events. Partially-addresses: #132 Signed-off-by: Andrea Frittoli <[email protected]>
- Loading branch information
Showing
6 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,20 +44,21 @@ go install github.com/neilpa/[email protected] | |
# - examples are subject_predicate.json | ||
# - schemas are subjectpredicate.json | ||
num_failed=0 | ||
num_examples=$(ls "$EXAMPLES_FOLDER" | wc -l | awk '{ print $1 }') | ||
for example in $(ls "$EXAMPLES_FOLDER"); do | ||
SUBJECT_PREDICATE=$(basename $example .json) | ||
num_examples=$(find "${EXAMPLES_FOLDER}" -type f -name '*json' | wc -l | awk '{ print $1 }') | ||
for example in $(find "${EXAMPLES_FOLDER}" -type f -name '*json'); do | ||
EXAMPLE_FILE=$(basename ${example}) | ||
SUBJECT_PREDICATE=$(basename $EXAMPLE_FILE .json) | ||
splitArray=(${SUBJECT_PREDICATE//_/ }) | ||
SUBJECT=${splitArray[0]} | ||
PREDICATE=${splitArray[1]} | ||
EXAMPLE_FILE=${EXAMPLES_FOLDER}/${example} | ||
SCHEMA_FILE=${SCHEMAS_FOLDER}/${SUBJECT}${PREDICATE}.json | ||
echo "==> $SUBJECT $PREDICATE" | ||
yajsv -s "$SCHEMA_FILE" "$EXAMPLE_FILE" || num_failed=$(( num_failed + 1 )) | ||
echo yajsv -s "$SCHEMA_FILE" "$example" | ||
yajsv -s "$SCHEMA_FILE" "$example" || num_failed=$(( num_failed + 1 )) | ||
echo | ||
done | ||
|
||
if [ $num_failed -gt 0 ]; then | ||
echo "${num_failed} out of ${num_examples} examples failed validation" | ||
fi | ||
exit $num_failed | ||
exit $num_failed |