Skip to content

Commit ead3235

Browse files
Merge branch 'main' into feature/pr_tperms
2 parents ae6b7a5 + 5bb0265 commit ead3235

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/generate-sbom.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ on:
1515
env:
1616
PYTHON_VERSION: '3.12'
1717
POETRY_VERSION: '2.0.1'
18+
PIA_DOMAIN: pia-staging.eclipse.org
1819

1920
permissions:
2021
contents: read
2122

2223
jobs:
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:
@@ -54,6 +57,28 @@ jobs:
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']

0 commit comments

Comments
 (0)