Skip to content

Dependency check

Dependency check #205

name: Dependency check
on:
push:
branches: [master]
schedule:
- cron: "0 8 * * *" # UTC
workflow_dispatch:
jobs:
dependency-check:
if: github.repository != 'tmfg/digitraffic-common-java'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 11
distribution: corretto
cache: maven
- name: Cache dependency-check files
uses: actions/cache@v4
with:
path: ~/.m2/repository/org/owasp
key: ${{ runner.os }}-dependency-check-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-dependency-check-
- name: Dependency check
run: mvn -Pdepcheck
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
MAVEN_OPTS: "-Xmx1024m"
- name: Publish report on GitHub Pages
if: ${{ success() || failure() }}
uses: tmfg/digitraffic-actions@gh-pages-publish/v1
with:
GH_PAGES_BRANCH: gh-pages
FILE_PATH: target/dependency-check-report.html
COMMIT_MESSAGE: Upload dependency check report
LINK_TEXT: Dependency check report
- name: Notify Slack
if: failure()
uses: 8398a7/action-slack@v3
with:
status: failure
text: FAILED Common Java Dependency Check
fields: repo, job, took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WARNINGS_WEBHOOK_URL }}