From b372dea20d3039b3bcaab309fada6c8c0f7f5bac Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 12 Feb 2025 16:22:17 +0200 Subject: [PATCH] [improve][ci] Skip "OWASP dependency check" in Pulsar CI if OWASP dep check data isn't cached --- .github/workflows/pulsar-ci.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index c004b61c2e362..0dfe0ce3a68a8 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -1494,15 +1494,21 @@ jobs: restore-keys: | owasp-dependency-check-data- + - name: Log warning when skipped + if: ${{ !steps.restore-owasp-dependency-check-data.outputs.cache-matched-key }} + run: | + echo "::warning::OWASP Dependency Check was skipped since the OWASP Dependency check data wasn't found in the cache. Run ci-owasp-dependency-check.yaml workflow to update the cache." + # Projects dependent on flume, hdfs, and hbase currently excluded from the scan. - name: trigger dependency check + if: ${{ steps.restore-owasp-dependency-check-data.outputs.cache-matched-key }} run: | mvn -B -ntp verify -PskipDocker,skip-all,owasp-dependency-check -Dcheckstyle.skip=true -DskipTests \ -pl '!distribution/server,!distribution/io,!distribution/offloaders,!tiered-storage/file-system,!pulsar-io/flume,!pulsar-io/hbase,!pulsar-io/hdfs3,!pulsar-io/docs,!pulsar-io/jdbc/openmldb' - name: Upload report uses: actions/upload-artifact@v4 - if: ${{ cancelled() || failure() }} + if: ${{ steps.restore-owasp-dependency-check-data.outputs.cache-matched-key && (cancelled() || failure()) }} continue-on-error: true with: name: dependency report