|
| 1 | +# Original action got from https://github.com/ossf/scorecard/blob/main/.github/workflows/scorecard-analysis.yml |
| 2 | + |
| 3 | +name: OWASP Dependency-Check analysis |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + # Weekly on Tuesdays at 08:00 PM UTC |
| 7 | + - cron: '0 20 * * 2' |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +# Visible only for the repository members |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + actions: read |
| 14 | + security-events: write |
| 15 | + |
| 16 | +jobs: |
| 17 | + dependency-check: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 22 | + - name: Set up JDK |
| 23 | + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 |
| 24 | + with: |
| 25 | + java-version: '21' |
| 26 | + distribution: 'jetbrains' |
| 27 | + |
| 28 | + - name: Run dependency check |
| 29 | + env: |
| 30 | + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} |
| 31 | + run: ./gradlew dependencyCheckAnalyze -Dnvd.api.key=$NVD_API_KEY |
| 32 | + |
| 33 | + - name: Upload Dependency Check Report |
| 34 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 35 | + if: always() # Load even if there are vulnerabilities |
| 36 | + with: |
| 37 | + name: dependency-check-report |
| 38 | + path: | |
| 39 | + ${{ github.workspace }}/build/reports/dependency-check-report.html |
| 40 | + ${{ github.workspace }}/build/reports/dependency-check-report.json |
| 41 | + ${{ github.workspace }}/build/reports/dependency-check-report.xml |
| 42 | + retention-days: 5 |
| 43 | + |
| 44 | + # Upload the results to GitHub's code scanning dashboard (optional). |
| 45 | + # Commenting out will disable upload of results to your repo's Code Scanning dashboard |
| 46 | + - name: Upload to GitHub Security Tab |
| 47 | + uses: github/codeql-action/upload-sarif@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1 |
| 48 | + if: always() && hashFiles('${{ github.workspace }}/build/reports/dependency-check-report.sarif') != '' |
| 49 | + with: |
| 50 | + sarif_file: ${{ github.workspace }}/build/reports/dependency-check-report.sarif |
| 51 | + category: dependency-check |
0 commit comments