Workflow file for this run
This file contains 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: 'This workflow creates bill of material and uploads it to Dependency-Track each night' | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
pull_request: | |
jobs: | |
create-bom: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: 'gradle' | |
- name: Change wrapper permission | |
run: chmod +x ./gradlew | |
- name: Generste BOM | |
run: gradle 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=189ca834-ad84-4d54-ac98-c3d0526f56cc" \ | |
-F "bom=@build/reports/bom.json" |