1- name : OWASP Dependency Check (.NET)
1+ name : Build + Dependency Check
22
33on :
4- workflow_dispatch :
54 push :
65 branches : [ main ]
76 pull_request :
87 branches : [ main ]
98
109jobs :
11- dependency-check :
12- name : Scan dependencies
10+ build-and-scan :
1311 runs-on : ubuntu-latest
1412
1513 steps :
14+ - name : Checkout
15+ uses : actions/checkout@v4
1616
17- - name : Install Dependency-Check
18- run : |
19- curl -Ls https://github.com/dependency-check/DependencyCheck/releases/download/v12.2.0/dependency-check-12.2.0-release.zip -o dependency-check-12.2.0-release.zip
20- unzip dependency-check-12.2.0-release.zip
21- ./dependency-check-12.2.0-release/bin/dependency-check.sh -h
22-
23- - name : Run scan
24- run : |
25- ./dependency-check-12.2.0-release/bin/dependency-check.sh \
26- --project "cas-dotnet-sdk" \
27- --scan . \
28- --format "HTML" \
29- --out reports
17+ # Setup .NET
18+ - name : Setup .NET
19+ uses : actions/setup-dotnet@v4
20+ with :
21+ dotnet-version : 10.0.x
22+
23+ # Restore dependencies
24+ - name : Restore
25+ run : dotnet restore
26+
27+ # Build project
28+ - name : Build
29+ run : dotnet build --no-restore --configuration Release
30+
31+ # Cache Dependency-Check DB (IMPORTANT for speed)
32+ - name : Cache Dependency-Check data
33+ uses : actions/cache@v4
34+ with :
35+ path : ~/.dependency-check
36+ key : dependency-check-${{ runner.os }}
37+ restore-keys : |
38+ dependency-check-
39+
40+ # Run OWASP Dependency Check
41+ - name : OWASP Dependency Check
42+ uses : dependency-check/Dependency-Check_Action@main
43+ with :
44+ project : " cas-dotnet-sdk"
45+ path : " ."
46+ format : " HTML"
47+ out : " dependency-check-report"
48+ args : >
49+ --failOnCVSS 7
50+ --enableRetired
51+
52+ # Upload report as artifact
53+ - name : Upload Dependency Check Report
54+ uses : actions/upload-artifact@v4
55+ with :
56+ name : dependency-check-report
57+ path : dependency-check-report
0 commit comments