|
17 | 17 | # Disabling shallow clone is recommended for improving relevancy of reporting |
18 | 18 | fetch-depth: 0 |
19 | 19 |
|
20 | | - - name: Cache maven repository |
21 | | - uses: actions/cache@v5 |
| 20 | + - name: Restore Cache - Maven Repository |
| 21 | + uses: actions/cache/restore@v5 |
22 | 22 | with: |
23 | 23 | path: | |
24 | 24 | ~/.m2/repository |
@@ -51,27 +51,25 @@ jobs: |
51 | 51 | run: | |
52 | 52 | mvn install sonar:sonar -P coverage -Dsonar.projectKey=FraunhoferIOSB_FAAAST-Service --settings maven-ci-settings.xml -B |
53 | 53 |
|
54 | | - - name: Restore CVD Database from Cache |
55 | | - uses: actions/cache/restore@v5 |
56 | | - with: |
57 | | - path: | |
58 | | - ~/.m2/repository/org/owasp/dependency-check-data |
59 | | - key: ${{ runner.os }}-maven-owasp-cvedb |
60 | | - |
61 | | - - name: Update CVD Database |
62 | | - env: |
63 | | - OWASP_OSS_INDEX_USERNAME: ${{ secrets.OWASP_OSS_INDEX_USERNAME }} |
64 | | - OWASP_OSS_INDEX_APIKEY: ${{ secrets.OWASP_OSS_INDEX_APIKEY }} |
65 | | - NIST_NVD_API_KEY: ${{ secrets.NIST_NVD_API_KEY }} |
| 54 | + - name: Get Date |
| 55 | + id: get-date |
66 | 56 | run: | |
67 | | - mvn -B -P owasp -DnvdApiDelay=6000 --settings maven-ci-settings.xml org.owasp:dependency-check-maven:update-only |
| 57 | + echo "date=$(/bin/date -u "+%Y-%m-%dT%H:%M:%S")" >> $GITHUB_OUTPUT |
| 58 | + shell: bash |
68 | 59 |
|
69 | | - - name: Save CVD Database to Cache |
70 | | - uses: actions/cache/save@v5 |
| 60 | + - name: Restore Cache - CVE Database |
| 61 | + uses: actions/cache/restore@v5 |
71 | 62 | with: |
72 | 63 | path: | |
73 | 64 | ~/.m2/repository/org/owasp/dependency-check-data |
74 | | - key: ${{ runner.os }}-maven-owasp-cvedb |
| 65 | + key: ${{ runner.os }}-maven-owasp-cvedb-${{ steps.get-date.outputs.date }} |
| 66 | + restore-keys: ${{ runner.os }}-maven-owasp-cvedb |
| 67 | + |
| 68 | + - name: Fail if cache not restored |
| 69 | + if: steps.cache.outputs.cache-hit != 'true' |
| 70 | + run: | |
| 71 | + echo "Failed to restore OWASP CVE Database - run update manually" |
| 72 | + exit 1 |
75 | 73 |
|
76 | 74 | - name: Dependency Vulnerability Check with OWASP |
77 | 75 | env: |
|
0 commit comments