Skip to content

Commit

Permalink
use DependencyCheck github action
Browse files Browse the repository at this point in the history
  • Loading branch information
EddeCCC committed Nov 26, 2024
1 parent 74471db commit 0f1660e
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- master
paths-ignore:
- 'README.md'
workflow_call:

env:
NVD_API_TOKEN: ${{ secrets.NVD_API_KEY }} # Token to access NVD API for dependency-check
Expand All @@ -34,5 +33,31 @@ jobs:
- uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Scan dependencies
run: ./gradlew dependencyCheckAnalyze
- name: build
run: ./gradlew assemble
# the action has not been updated a while, but it always uses the latest plugin version
- name: Run DependencyCheck plugin
uses: dependency-check/Dependency-Check_Action@main
id: depcheck
continue-on-error: true # we still want to upload the report
with:
project: ${{ github.repository }}
path: '.'
format: 'HTML'
out: 'reports'
args: >
--failOnCVSS 6
--disableAssembly
--nvdApiKey ${{ secrets.NVD_API_KEY }}
--nvdApiDelay 10000
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: dependency-check-report-eum-server
path: ${{ github.workspace }}/reports
# if DependencyCheck failed, the job should also fail, but only after the results were uploaded
- name: Validate DependencyCheck outcome
if: ${{ steps.depcheck.outcome == 'failure' }}
run: |
echo "DependencyCheck failed"
exit 1

0 comments on commit 0f1660e

Please sign in to comment.