Dependency Tracker #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |