-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -458,11 +458,54 @@ jobs: | |
echo "Individual reports for master and pr have been saved under the Artifacts tab." | ||
exit 0 | ||
fi | ||
- persist_to_workspace: | ||
root: /tmp/repos | ||
paths: | ||
- master_report.sbom | ||
- store_artifacts: | ||
path: /tmp/repos/master_report.sbom | ||
- store_artifacts: | ||
path: /tmp/repos/pr_report.sbom | ||
|
||
update_security_status_badge: | ||
machine: | ||
image: ubuntu-2204:2024.08.1 | ||
resource_class: medium | ||
working_directory: /tmp/repos | ||
environment: | ||
SUCCESS_MESSAGE: 'passing' | ||
SUCCESS_COLOR: 'brightgreen' | ||
FAILURE_MESSAGE: 'failing' | ||
FAILURE_COLOR: 'FF0A0A' | ||
SEVERITY_THRESHOLD: 'CRITICAL' | ||
steps: | ||
- attach_workspace: | ||
at: /tmp/repos | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "SHA256:vtzpWrYBLQAMgZIsEv3Nuc1HeINJXFFtUB+IpSY/AK4" | ||
- run: | ||
name: Set up Git user | ||
command: | | ||
git config --global user.name "CircleCI Bot" | ||
git config --global user.email "[email protected]" | ||
- run: | ||
name: Count vulnerabilities and update status badge | ||
command: | | ||
COUNT=$(jq '[.[] | select(.severity == "$SEVERITY_THRESHOLD")] | length' master_report.sbom) | ||
cd cbioportal-test | ||
if [ $COUNT -eq 0 ]; then | ||
MESSAGE=$SUCCESS_MESSAGE | ||
COLOR=$SUCCESS_COLOR | ||
else | ||
MESSAGE=$FAILURE_MESSAGE | ||
COLOR=$FAILURE_COLOR | ||
fi | ||
jq '.message = $MESSAGE | .color = $COLOR' security-status.json > security-status.json | ||
git add -A | ||
git commit -m "Update security status" | ||
git push | ||
workflows: | ||
end_to_end_tests: | ||
jobs: | ||
|
@@ -501,4 +544,7 @@ workflows: | |
context: | ||
- docker-scout | ||
requires: | ||
- build_image | ||
- build_image | ||
- update_security_status_badge: | ||
requires: | ||
- run_security_tests |
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