diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index dfe47fbe..e4be09c1 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -29,7 +29,7 @@ jobs: if: ${{ github.base_ref != 'main' }} uses: actions/setup-java@v1 with: - java-version: 17 + java-version: ${{ needs.parameters.outputs.jdk_build }} - name: 'Configure: Install GraalVM' if: ${{ github.base_ref == 'main' }} uses: graalvm/setup-graalvm@v1 @@ -92,6 +92,13 @@ jobs: exit $RC fi fi + - name: 'Configure: Install Trivy' + uses: ./.github/actions/install-trivy + - name: 'Action: Trivy scan' + shell: bash + run: | + BUILD_DIR=$(realpath $MAIN_PATH) + $BUILD_DIR/scan-folders.sh table - name: 'Upload: Error logs' if: ${{ failure() }} uses: actions/upload-artifact@v3 diff --git a/scripts/determine-modules-changed.sh b/scripts/determine-modules-changed.sh index fccf11ea..da9f52a4 100755 --- a/scripts/determine-modules-changed.sh +++ b/scripts/determine-modules-changed.sh @@ -17,10 +17,26 @@ function addItem() { fi } MODIFIED="$*" -ALL_MODULES=$(find . -name "pom.xml" -type f -exec dirname '{}' \; | sed 's/\.\///' | sort -r) +ALL_MODULES=$(find . -name "pom.xml" -not -path './spring-cloud-dataflow-apps-plugin/*' -type f -exec dirname '{}' \; | sed 's/\.\///' | sort -r) +MODULES= +for file in $MODIFIED; do + FILE=$(realpath $file) + echo "$file was changed" + for ITEM in $ALL_MODULES; do + if [[ "$ITEM" != "." ]] && [[ "$file" == *"$ITEM"* ]]; then + echo "Matched $ITEM" + HAS_ITEM=$(itemInModules) + if ((HAS_ITEM == 0)); then + echo "Add:$ITEM" + MODULES=$(addItem "$ITEM") + fi + break + fi + done +done echo "[" >modules.json COUNT=0 -for module in $ALL_MODULES; do +for module in $MODULES; do if ((COUNT > 0)); then echo "," >> modules.json fi