Skip to content

Dependency Tracker

Dependency Tracker #9

name: 'Dependency Tracker'
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
create-bom:
name: Create and Upload SBOM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: 'gradle'
- name: Change wrapper permission
run: chmod +x ./gradlew
- name: Generate BOM
run: ./gradlew cyclonedxBom
- name: Upload SBOM to DependencyTrack
env:
DEPENDENCY_TRACK_API: 'https://dt.security.dhis2.org/api/v1/bom'
run: |
curl -X POST "$DEPENDENCY_TRACK_API" \
--fail-with-body \
-H "Content-Type: multipart/form-data" \
-H "X-Api-Key: ${{ secrets.DEPENDENCYTRACK_APIKEY }}" \
-F "project=5d9c948b-3968-4f47-867f-3b7f04ba9fb6" \
-F "bom=@build/reports/bom.json"