Skip to content

Commit aab8e8c

Browse files
committed
Add Dep Check WF
1 parent 24c4939 commit aab8e8c

File tree

2 files changed

+95
-11
lines changed

2 files changed

+95
-11
lines changed

.github/workflows/depcheck.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Dependency Check
2+
3+
on:
4+
workflow_dispatch:
5+
# push:
6+
# branches: [ main, dev ]
7+
# paths: src/**
8+
# pull_request:
9+
# branches: [ main ]
10+
# paths: src/**
11+
12+
# # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
# permissions:
14+
# contents: read
15+
# pages: write
16+
# id-token: write
17+
18+
jobs:
19+
depcheck:
20+
runs-on: ubuntu-latest
21+
name: OWASP Dependency-Check
22+
# defaults:
23+
# run:
24+
# working-directory: src
25+
26+
steps:
27+
- name: 🛎️ Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: ⚙️ Setup .NET 8.0
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: "8.0.x"
34+
# include-prerelease: true
35+
36+
- name: ⬇️ Restore dependencies
37+
run: dotnet restore
38+
working-directory: src
39+
40+
- name: 🔨 Build
41+
run: dotnet build --no-restore
42+
working-directory: src
43+
44+
# - name: 🧪 Unit Testing
45+
# run: dotnet test --collect:"XPlat Code Coverage"
46+
# working-directory: src
47+
48+
# - name: 🚀 Publish Test Results
49+
# uses: EnricoMi/publish-unit-test-result-action@v2
50+
# if: always()
51+
# with:
52+
# xunit_files: 'src/**/TestResults/**/coverage.cobertura.xml'
53+
54+
- name: 👴🏻 Check vulnerable packages
55+
run: dotnet list package --vulnerable
56+
working-directory: src
57+
58+
- name: 🏁 Dependency Check
59+
uses: dependency-check/Dependency-Check_Action@main
60+
id: Depcheck
61+
with:
62+
project: "test"
63+
path: "./src"
64+
format: "HTML"
65+
out: "reports" # this is the default, no need to specify unless you wish to override it
66+
args: >
67+
--failOnCVSS 11
68+
--enableRetired
69+
# --suppression ./src/dependency-suppression.xml
70+
71+
- name: ⬆️ Upload Test results
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: Depcheck report
75+
path: ${{github.workspace}}/reports
76+
77+
- name: 🌍 Commit wwwroot to GitHub Pages
78+
uses: JamesIves/[email protected]
79+
with:
80+
token: ${{ secrets.GITHUB_TOKEN }}
81+
branch: gh-pages
82+
folder: ${{github.workspace}}/reports
83+
target-folder: reports
84+
clean: false

.github/workflows/main.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 🚀 Deploy to GitHub Pages
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ main ]
6+
branches: [main]
77
paths: src/**
88
# pull_request:
99
# branches: [ main ]
@@ -18,22 +18,22 @@ on:
1818
jobs:
1919
deploy:
2020
runs-on: ubuntu-latest
21-
22-
# defaults:
23-
# run:
24-
# working-directory: src
25-
21+
22+
# defaults:
23+
# run:
24+
# working-directory: src
25+
2626
steps:
2727
- name: 🚚 Checkout
2828
uses: actions/checkout@v4
2929
with:
3030
submodules: true
31-
32-
- name: Setup .NET 8.0
31+
32+
- name: Setup .NET 8.0
3333
uses: actions/setup-dotnet@v4
3434
with:
35-
dotnet-version: '8.0.x'
36-
# include-prerelease: true
35+
dotnet-version: "8.0.x"
36+
# include-prerelease: true
3737

3838
- name: ⬇️ Restore dependencies
3939
working-directory: ./src
@@ -42,7 +42,7 @@ jobs:
4242
- name: 🔨 Build
4343
working-directory: ./src
4444
run: dotnet build --no-restore
45-
45+
4646
- name: 📦 Run
4747
working-directory: ./src
4848
run: dotnet run

0 commit comments

Comments
 (0)