File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 - main
77 - develop
88 pull_request :
9+ workflow_dispatch :
10+ schedule :
11+ - cron : " 0 5 * * 1"
912
1013jobs :
1114 build-test :
@@ -111,6 +114,7 @@ jobs:
111114 dependency-scan :
112115 name : Dependency Vulnerability Scan
113116 runs-on : ubuntu-latest
117+ timeout-minutes : 25
114118 env :
115119 NVD_API_KEY : ${{ secrets.NVD_API_KEY }}
116120
@@ -128,20 +132,21 @@ jobs:
128132 - name : Make Maven Wrapper executable
129133 run : chmod +x mvnw
130134
135+ - name : Skip scan when NVD API key is not configured
136+ if : ${{ env.NVD_API_KEY == '' }}
137+ run : echo "::notice::Skipping OWASP Dependency-Check because NVD_API_KEY is not configured."
138+
131139 - name : Run OWASP Dependency-Check
140+ if : ${{ env.NVD_API_KEY != '' }}
132141 shell : bash
133142 run : |
134- EXTRA_ARGS=""
135- if [[ -n "${NVD_API_KEY}" ]]; then
136- EXTRA_ARGS="-DnvdApiKey=${NVD_API_KEY}"
137- fi
138143 ./mvnw -B -ntp org.owasp:dependency-check-maven:check \
139144 -Dformats=HTML,XML \
140145 -DprettyPrint=true \
141- ${EXTRA_ARGS}
146+ -DnvdApiKey="${NVD_API_KEY}"
142147
143148 - name : Upload dependency-check reports
144- if : always()
149+ if : ${{ always() && env.NVD_API_KEY != '' }}
145150 uses : actions/upload-artifact@v4
146151 with :
147152 name : dependency-check-report
You can’t perform that action at this time.
0 commit comments