Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/generate-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,19 @@ jobs:
with:
virtualenvs-in-project: true
version: ${{ env.POETRY_VERSION }}
# cyclonedx-py comes from the sbom group of poetry.lock, kept up to date by Dependabot. It is taken from the
# commit of this workflow, available thanks to fetch-depth 0: the version checked out may predate the group.
- name: Install cyclonedx-py
run: pipx install cyclonedx-bom==7.6.0
shell: bash
env:
# the copy is not a git repository, and the version of the project does not matter for the tool
POETRY_DYNAMIC_VERSIONING_BYPASS: '0.0.0'
run: |
tool_dir="$RUNNER_TEMP/sbom-tool"
mkdir -p "$tool_dir"
git show "$GITHUB_WORKFLOW_SHA:pyproject.toml" > "$tool_dir/pyproject.toml"
git show "$GITHUB_WORKFLOW_SHA:poetry.lock" > "$tool_dir/poetry.lock"
poetry -C "$tool_dir" install --only=sbom --no-root
- name: "Get project version and export requirements"
id: export
shell: bash
Expand All @@ -50,7 +61,8 @@ jobs:
VERSION=$(poetry version -s | sed 's/.dev[0-9]*/.dev/')
echo "PROJECT_VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Generate sbom
run: cyclonedx-py requirements --spec-version 1.6 -o otterdog-bom.json
run: |
"$RUNNER_TEMP/sbom-tool/.venv/bin/cyclonedx-py" requirements --spec-version 1.6 -o otterdog-bom.json
- name: Upload sbom
uses: eclipse-csi/workflows/upload-sbom@d2d3dbbc0a1907f41892c1698b3c6353235c87cb # main
with:
Expand Down
Loading
Loading