Skip to content

Attempts to fix path #10

Attempts to fix path

Attempts to fix path #10

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 > container-sbom_cyclonedx.json
syft phase_1_python \
-o spdx-json > container-sbom_spdx.json
- name: Upload CycloneDX SBOM
uses: actions/upload-artifact@v3
with:
name: container-sbom-cyclonedx
path: "Phase 1/Python/container-sbom_cyclonedx.json"
- name: Upload SPDX SBOM
uses: actions/upload-artifact@v3
with:
name: container-sbom-spdx
path: "Phase 1/Python/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 \
> application-sbom_cyclonedx.json
- name: Upload CycloneDX SBOM
uses: actions/upload-artifact@v3
with:
name: application-sbom-cyclonedx
path: "Phase 1/Python/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: "CycloneDX: Generate Merged SBOM"
run: |
sbommerge \
--format json \
--sbom cyclonedx \
--output-file flattened-cyclonedx.json \
container-sbom_cyclonedx.json \
application-sbom_cyclonedx.json
- name: Upload Combined CycloneDX SBOM
uses: actions/upload-artifact@v3
with:
name: application-sbom-cyclonedx
path: "flattened-cyclonedx.json"
Validate:
needs: Assemble
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# TODO: Validate output