77env :
88 MVN_MULTI_THREADED_ARGS : --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C
99 JAVA_VERSION : 17
10+ CVE_CACHE_KEY : cve-db
11+ CVE_CACHE_DIR : ~/.m2/repository/org/owasp/dependency-check-data
12+ CVE_CACHE_REF : refs/heads/main
1013
1114jobs :
1215 create_fosstars_report :
@@ -22,29 +25,52 @@ jobs:
2225 distribution : " temurin"
2326 java-version : ${{ env.JAVA_VERSION }}
2427 cache : ' maven'
28+
2529 - name : Restore CVE Database
2630 uses : actions/cache/restore@v4
2731 with :
2832 path : ${{ env.CVE_CACHE_DIR }}
2933 key : ${{ env.CVE_CACHE_KEY }}
30- fail-on-cache-miss : true
34+ # fail-on-cache-miss: true
3135
3236 - name : " Build SDK"
3337 run : |
3438 MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
3539 mvn $MVN_ARGS
3640
37- - name : " OWASP Dependency check"
38- run : mvn org.owasp:dependency-check-maven:11.1.0:check -DnvdApiKey=$NVD_API_KEY -DfailBuildOnCVSS=7 -DskipProvidedScope=true -DsuppressionFile=.pipeline/dependency-check-suppression.xml -DautoUpdate=false
39- env :
40- NVD_API_KEY : ${{ secrets.NVD_API_KEY }}
41-
42- - name : " Fosstars rating"
41+ - name : " Fosstars Rating"
43424443 with :
4544 report-branch : fosstars-report
4645 token : ${{ secrets.GITHUB_TOKEN }}
4746
47+ - name : " CVE Scan"
48+ run : |
49+ mvn -T1 --no-transfer-progress dependency-check:check dependency-check:aggregate
50+
51+ # - name: "Archive CVE Report"
52+ # uses: actions/upload-artifact@v4
53+ # with:
54+ # name: cve-report
55+ # path: target/dependency-check-report.html
56+ # retention-days: 7
57+
58+ - name : Delete Old CVE Cache
59+ run : |
60+ CACHE_IDS=$(gh cache list --key "${{ env.CVE_CACHE_KEY }}" --ref "${{ env.CVE_CACHE_REF }}" --json id | jq -r '.[] | .id')
61+ for CACHE_ID in $CACHE_IDS; do
62+ echo "Deleting cache with ID: $CACHE_ID"
63+ gh cache delete "${CACHE_ID}"
64+ done
65+ env :
66+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67+
68+ - name : Create Updated CVE Cache
69+ uses : actions/cache/save@v4
70+ with :
71+ path : ${{ env.CVE_CACHE_DIR }}
72+ key : ${{ env.CVE_CACHE_KEY }}
73+
4874 - name : " Slack Notification"
4975 if : failure()
5076
0 commit comments