chore: remove deprecated SBOM workflow (#256)

* chore: remove deprecated SBOM workflow

* quickfix

---------

Co-authored-by: Robert Sturla <robertsturla@outlook.com>
This commit is contained in:
Juha Uotila 2025-03-09 08:55:18 +02:00 committed by GitHub
parent 2dde0ec1c8
commit 7fa14e24ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 129 deletions

11
.github/syft.yml vendored
View file

@ -1,11 +0,0 @@
# Exclude some files Syft will never get anything useful from
exclude:
- '/sysroot/ostree/repo/objects/**'
- '/usr/share/icons/**'
- '/usr/share/doc/**'
# There's a known issue with the previous releases where ELF cataloger uses far
# too much memory, causing crashes. Current recommendation is to disable this
# until the Anchore team have investigated and rolled out a fix
select-catalogers:
- '-elf-package'

View file

@ -17,10 +17,7 @@ on:
kernel_pin:
description: "The full kernel version to pin"
type: string
outputs:
images:
description: "An array of images built and pushed to the registry"
value: ${{ jobs.check.outputs.images }}
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
@ -45,16 +42,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install Just
shell: bash
run: bash .github/workflows/shared/install-just.sh
- name: Check Just Syntax
shell: bash
run: |
just check
- name: Image Name
shell: bash
run: |
@ -126,7 +123,7 @@ jobs:
echo "Tags for this Action..."
echo "$alias_tags"
echo "alias_tags=${alias_tags}" >> $GITHUB_OUTPUT
# Tag Images
- name: Tag Images
shell: bash
@ -227,37 +224,7 @@ jobs:
if: always()
runs-on: ubuntu-latest
needs: [build_container]
outputs:
images: ${{ steps.generate-outputs.outputs.images }}
steps:
- name: Download artifacts
if: github.event_name != 'pull_request'
id: download-artifacts
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
with:
pattern: image-*
merge-multiple: true
- name: Create output
if: github.event_name != 'pull_request'
id: generate-outputs
env:
JOBS: ${{ toJson(needs) }}
ARTIFACT_PATH: ${{ steps.download-artifacts.outputs.download-path }}
run: |
# Initialize the array
images=()
# Populate the array with each line from each file in the artifacts directory
for file in $ARTIFACT_PATH/*; do
while IFS= read -r line; do
images+=("$line")
done < "$file"
done
# Create the GITHUB_OUTPUT in the format '["image1", "image2", ...]'
echo "images=$(printf '%s\n' "${images[@]}" | jq -R -s -c 'split("\n") | .[:-1]')" >> $GITHUB_OUTPUT
- name: Check Jobs
env:
JOBS: ${{ toJson(needs) }}

View file

@ -1,80 +0,0 @@
name: Scan and SBOM
on:
workflow_call:
inputs:
images:
description: "A comma-separated list of images to scan. E.G. '[\"docker.io/library/alpine:3.14.0\", \"docker.io/library/alpine:3.13.6\"]'"
required: true
type: string
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set matrix
id: set-matrix
env:
IMAGES: ${{ inputs.images }}
run: |
echo "matrix=$IMAGES" >> $GITHUB_OUTPUT
scan-image:
needs: generate-matrix
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
image: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9
- name: Install Syft
shell: bash
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
syft version
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@d0603cd0a7dd490be678164909f65c7737470a7f # v6
with:
string: ${{ matrix.image }}
- name: Generate SBOM
env:
IMAGE: ${{ steps.registry_case.outputs.lowercase }}
run: |
syft ${IMAGE} \
--output cyclonedx-json=sbom.json \
--config ./.github/syft.yml
- name: Scan SBOM
id: scan
uses: anchore/scan-action@7c05671ae9be166aeb155bad2d7df9121823df32 # v6
with:
sbom: sbom.json
output-format: json
fail-build: false
- name: Generate artifact name
id: artifact-name
env:
IMAGE: ${{ steps.registry_case.outputs.lowercase }}
run: |
echo "name=$(echo ${IMAGE} | awk -F'/' '{print $NF}' | sed 's/:/-/g')" >> $GITHUB_OUTPUT
- name: Upload scan results
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
with:
name: security-${{ steps.artifact-name.outputs.name }}
if-no-files-found: error
path: |
sbom.json
${{ steps.scan.outputs.json }}