Skip to content

Fixes path

Fixes path #15

Workflow file for this run

---
name: Phase 1 - Python
on: [push]
jobs:
Container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# We're using native docker build here rather
# than 'docker/build-push-action' to make the run
# more pipeline agnostic.
- name: Build Docker image
working-directory: "Phase 1/Python"
run: |
docker build -t phase_1_python .
# This should probably be pinned and verified
- name: Install Syft
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | \
sh -s -- -b /usr/local/bin
- name: Generate SBOM with Syft
working-directory: "Phase 1/Python"
run: |
syft phase_1_python \
-o cyclonedx-json > /tmp/container-sbom_cyclonedx.json
syft phase_1_python \
-o spdx-json > /tmp/container-sbom_spdx.json
- name: Upload CycloneDX SBOM
uses: actions/upload-artifact@v4
with:
name: container-sbom-cyclonedx
path: "/tmp/container-sbom_cyclonedx.json"
- name: Upload SPDX SBOM
uses: actions/upload-artifact@v4
with:
name: container-sbom-spdx
path: "/tmp/container-sbom_spdx.json"
Application:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Should probably pin this dependency
- name: "CycloneDX: Install Dependency"
working-directory: "Phase 1/Python"
run: |
python -m pip install cyclonedx-bom
- name: "CycloneDX: Generate SBOM"
working-directory: "Phase 1/Python"
run: |
cyclonedx-py requirements requirements.txt \
> /tmp/application-sbom_cyclonedx.json
- name: Upload CycloneDX SBOM
uses: actions/upload-artifact@v4
with:
name: application-sbom-cyclonedx
path: "/tmp/application-sbom_cyclonedx.json"
# TODO: Add SPDX Generation
Assemble:
runs-on: ubuntu-latest
needs: [Container, Application]
steps:
- uses: actions/checkout@v4
# Should probably pin this dependency
- name: "Install sbommerge"
run: |
python -m pip install sbommerge
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: "Debug: SBOMs"
run: |
find . -iname *.json
- name: "CycloneDX: Generate Merged SBOM"
run: |
sbommerge \
--format json \
--sbom cyclonedx \
--output-file /tmp/flattened-cyclonedx.json \
container-sbom-cyclonedx/container-sbom_cyclonedx.json \
application-sbom-cyclonedx/application-sbom_cyclonedx.json
- name: Upload Combined CycloneDX SBOM
uses: actions/upload-artifact@v4
with:
name: flatten-sbom-cyclonedx
path: "/tmp/flattened-cyclonedx.json"
Validate:
needs: Assemble
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# TODO: Validate output