Skip to content

chore(deps): bump the github-actions group with 4 updates (#678) #541

chore(deps): bump the github-actions group with 4 updates (#678)

chore(deps): bump the github-actions group with 4 updates (#678) #541

Workflow file for this run

name: Generate and ingest SBOM into sbom.eclipse.org
on:
push:
branches: [main]
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: 'Version'
default: 'main'
required: true
env:
PYTHON_VERSION: '3.12'
POETRY_VERSION: '2.0.1'
PIA_DOMAIN: pia-staging.eclipse.org
permissions:
contents: read
jobs:
generate-sbom:
runs-on: ubuntu-latest
permissions:
id-token: write
outputs:
project-version: ${{ steps.export.outputs.PROJECT_VERSION }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 0
ref: ${{ github.event.inputs.version }}
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
with:
virtualenvs-in-project: true
version: ${{ env.POETRY_VERSION }}
- name: Install cyclonedx-py
run: pipx install cyclonedx-bom==5.1.1
- name: "Get project version and export requirements"
id: export
shell: bash
run: |
poetry install
poetry export --only=main,app -o requirements.txt
VERSION=$(poetry version -s | sed 's/.dev[0-9]*/.dev/')
echo "PROJECT_VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Generate sbom
run: cyclonedx-py requirements -o otterdog-bom.json
- name: Upload sbom
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom
path: otterdog-bom.json
# Upload SBOM to sbom-staging.eclipse.org using pia-staging.eclipse.org
- name: Upload SBOM via PIA (experimental)
run: |
# Get OIDC token from GitHub Identity Provider
ID_TOKEN=$(curl -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=${{ env.PIA_DOMAIN }}" | jq -r '.value')
# Create PIA payload on disk
# The bom data is too long for passing it direclty as curl option
cat > otterdog-pia.json <<EOF
{
"product_name": "otterdog",
"product_version": "${{ steps.export.outputs.PROJECT_VERSION }}",
"bom": "$(base64 --wrap=0 otterdog-bom.json)"
}
EOF
# Upload to PIA
curl --fail-with-body https://${{ env.PIA_DOMAIN }}/v1/upload/sbom \
-H "Authorization: Bearer ${ID_TOKEN}" \
--json "@otterdog-pia.json"
store-sbom-data: # stores sbom and metadata in a predefined format for otterdog to pick up
needs: ['generate-sbom']
uses: eclipse-csi/workflows/.github/workflows/store-sbom-data.yml@main
with:
projectName: 'otterdog'
projectVersion: ${{ needs.generate-sbom.outputs.project-version }}
bomArtifact: 'sbom'
bomFilename: 'otterdog-bom.json'
parentProject: 'caa07057-876a-44f9-b162-d2c0684e5dc5'