File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515env :
1616 PYTHON_VERSION : ' 3.12'
1717 POETRY_VERSION : ' 2.0.1'
18+ PIA_DOMAIN : pia-staging.eclipse.org
1819
1920permissions :
2021 contents : read
2122
2223jobs :
2324 generate-sbom :
2425 runs-on : ubuntu-latest
26+ permissions :
27+ id-token : write
2528 outputs :
2629 project-version : ${{ steps.export.outputs.PROJECT_VERSION }}
2730 steps :
5457 with :
5558 name : sbom
5659 path : otterdog-bom.json
60+ # Upload SBOM to sbom-staging.eclipse.org using pia-staging.eclipse.org
61+ - name : Upload SBOM via PIA (experimental)
62+ run : |
63+ # Get OIDC token from GitHub Identity Provider
64+ ID_TOKEN=$(curl -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \
65+ "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=${{ env.PIA_DOMAIN }}" | jq -r '.value')
66+
67+ # Create PIA payload on disk
68+ # The bom data is too long for passing it direclty as curl option
69+ cat > otterdog-pia.json <<EOF
70+ {
71+ "product_name": "otterdog",
72+ "product_version": "${{ steps.export.outputs.PROJECT_VERSION }}",
73+ "bom": "$(base64 --wrap=0 otterdog-bom.json)"
74+ }
75+ EOF
76+
77+ # Upload to PIA
78+ curl --fail-with-body https://${{ env.PIA_DOMAIN }}/v1/upload/sbom \
79+ -H "Authorization: Bearer ${ID_TOKEN}" \
80+ --json "@otterdog-pia.json"
81+
5782
5883 store-sbom-data : # stores sbom and metadata in a predefined format for otterdog to pick up
5984 needs : ['generate-sbom']
You can’t perform that action at this time.
0 commit comments