|
| 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 | + |
| 79 | + with: |
| 80 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 81 | + branch: gh-pages |
| 82 | + folder: ${{github.workspace}}/reports |
| 83 | + target-folder: reports |
| 84 | + clean: false |
0 commit comments