Skip to content

This workflow creates bill of material and uploads it to Dependency-Track each night #11

This workflow creates bill of material and uploads it to Dependency-Track each night

This workflow creates bill of material and uploads it to Dependency-Track each night #11

name: 'This workflow creates bill of material and uploads it to Dependency-Track each night'
on:
schedule:
- cron: '0 0 * * *'
jobs:
create-bom:
name: Create and Upload SBOM
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: ./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=189ca834-ad84-4d54-ac98-c3d0526f56cc" \
-F "bom=@build/reports/bom.json"