Skip to content

Commit

Permalink
Add new workflow and update schema version of cyclonedx
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Jan 24, 2025
1 parent 6e70a66 commit 575c20a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/deptrack-test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Deptrack deploy'

on:
push:
branches: [ production ]

jobs:
generate-and-push-sbom:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install cdxgen
working-directory: frontend
run: npm install -g @cyclonedx/[email protected]

- name: 'Generate SBOM for maven dependencies'
working-directory: backend
run: mvn org.cyclonedx:cyclonedx-maven-plugin:makeAggregateBom

- name: 'Generate SBOM for npm dependencies'
working-directory: frontend
run: cdxgen -o ../sbom-npm.xml -t npm .

- name: 'Merge frontend and backend SBOMs'
run: |
docker run --rm -v $(pwd):/data cyclonedx/cyclonedx-cli merge --input-files data/backend/target/bom.xml data/sbom-npm.xml --output-file data/sbom.xml
- name: 'Push merged SBOM to dependency track'
env:
PROJECT_NAME: okr-production
run: |
curl --verbose -s --location --request POST ${{ secrets.DEPENDENCY_TRACK_URL }} \
--header "X-Api-Key: ${{ secrets.SECRET_OWASP_DT_KEY }}" \
--header "Content-Type: multipart/form-data" \
--form "autoCreate=true" \
--form "projectName=${PROJECT_NAME:-$GITHUB_REPOSITORY}" \
--form "projectVersion=latest" \
--form "[email protected]"
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<artifactId>cyclonedx-maven-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<schemaVersion>1.4</schemaVersion>
<schemaVersion>1.6</schemaVersion>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 575c20a

Please sign in to comment.