Skip to content

Commit

Permalink
squash me: group logs of generate SBOMs step
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorbenLindhauer committed Oct 6, 2023
1 parent 583276c commit 956ed3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions java-dependency-check/generate-sboms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@
set -e
# let script stop when one of the commands fails (e.g. one of the Maven builds)

echo "::group::git fetch"
git fetch
echo "::endgroup::"

if [[ $(git diff origin/$GITHUB_BASE_REF HEAD --name-only | grep pom.xml$ | wc -c) -ne 0 ]]; then

echo "POM changes detected. Diffing SBOMs"

mkdir -p target/diff

echo "::group::Generate base SBOM"
mvn -s "$1" --no-transfer-progress org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom
echo "::endgroup::"

echo "SBOM generated for github ref HEAD"

cp target/bom.json target/diff/head.json

git checkout -f origin/$GITHUB_BASE_REF

echo "::group::Generate head SBOM"
mvn -s "$1" --no-transfer-progress org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom
echo "::endgroup::"

echo "SBOM generated for github ref $GITHUB_BASE_REF"

Expand Down

0 comments on commit 956ed3a

Please sign in to comment.