Skip to content

Commit 82aa285

Browse files
committed
Cache OWASP Dependency Check database in CI
1 parent 240b966 commit 82aa285

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/cve-scanning-gradle.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
uses: gradle/actions/setup-gradle@v3
2525
with:
2626
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
27+
- name: Cache OWASP Dependency Check Database
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.gradle/dependency-check-data
31+
key: ${{ runner.os }}-owasp-db-${{ github.run_id }}
32+
restore-keys: |
33+
${{ runner.os }}-owasp-db-
2734
- name: Build with Gradle
2835
# The build action is not strictly necessary as dependencyCheckAggregate will build the project
2936
# but it's good practice to have it as a separate step to catch build errors earlier.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencyCheck {
6262
failBuildOnCVSS=5
6363
suppressionFile="./allow-list.xml"
6464
data {
65-
directory = "${buildDir}/dependency-check-data"
65+
directory = "${System.getProperty('user.home')}/.gradle/dependency-check-data"
6666
}
6767
nvd {
6868
apiKey = System.getenv("NVD_API_KEY") ?: (project.findProperty("dependencyCheck.nvd.apiKey") ?: "")

0 commit comments

Comments
 (0)