Add SBOM CI (Infra) #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Checkbox Snap - Software Bill of Materials (SBOM) | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_call: | |
| inputs: | |
| SERIES: | |
| description: 'Checkbox snap series (e.g., 20, 22, 24)' | |
| type: string | |
| default: "24" | |
| required: true | |
| CHANNEL: | |
| description: 'Checkbox snap channel (e.g., latest/stable)' | |
| type: string | |
| default: latest/stable | |
| required: true | |
| workflow_dispatch: | |
| inputs: | |
| SERIES: | |
| description: 'Checkbox snap series (e.g., 20, 22, 24)' | |
| type: string | |
| default: "24" | |
| required: true | |
| CHANNEL: | |
| description: 'Checkbox snap channel (e.g., latest/stable)' | |
| type: string | |
| default: latest/stable | |
| required: true | |
| permissions: | |
| contents: read # Required to check out repository code | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| sbom: | |
| name: Checkbox Snap - Software Bill of Materials (SBOM) | |
| runs-on: | |
| - self-hosted-linux-amd64-noble-private-endpoint-medium | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update -qq | |
| sudo apt install -y \ | |
| git-lfs | |
| - name: Checkout Repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| lfs: true | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| with: | |
| python-version: "3.12" | |
| - name: Install python dependencies | |
| run: | | |
| pip install requests | |
| - name: Request and retrieve SBOM | |
| id: sbom | |
| env: | |
| SBOM_SCRIPT_PATH: .github/scripts/sbom/sbom.py | |
| # CHECKBOX_SERIES: ${{ inputs.SERIES }} | |
| # CHECKBOX_CHANNEL: ${{ inputs.CHANNEL }} | |
| CHECKBOX_SERIES: 24 | |
| CHECKBOX_CHANNEL: latest/stable | |
| run: python3 -u ${SBOM_SCRIPT_PATH} --series=${CHECKBOX_SERIES} --channel=${CHECKBOX_CHANNEL} | |
| - name: Collect SBOM | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| with: | |
| name: checkbox${{ steps.sbom.outputs.series }}-${{ steps.sbom.outputs.revision }}-sbom | |
| path: /tmp/checkbox${{ steps.sbom.outputs.series }}-${{ steps.sbom.outputs.revision }}.sbom.json | |
| retention-days: 5 |