Skip to content

Bump anchore/sbom-action from 0.14.3 to 0.17.7 #119

Bump anchore/sbom-action from 0.14.3 to 0.17.7

Bump anchore/sbom-action from 0.14.3 to 0.17.7 #119

Workflow file for this run

---
name: Package
on:
push:
workflow_dispatch:
env:
IMAGE_REGISTRY: quay.io
IMAGE_REPO: lucarval/festoji
IMAGE_TAGS: latest
jobs:
build:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
permissions:
# Needed for signing the container image with GitHub OIDC Token
id-token: write
outputs:
image: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }}
digest: ${{ steps.push-image.outputs.digest }}
steps:
- uses: actions/checkout@v3
- name: Install Cosign
uses: sigstore/cosign-installer@main
- name: Install Syft
uses: anchore/sbom-action/[email protected]
- name: Log in to Red Hat Registry
uses: redhat-actions/podman-login@v1
with:
registry: registry.redhat.io
username: ${{ secrets.REGISTRY_REDHAT_IO_USER }}
password: ${{ secrets.REGISTRY_REDHAT_IO_PASSWORD }}
- name: Log in to quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ vars.REGISTRY_QUAY_IO_USER }}
password: ${{ secrets.REGISTRY_QUAY_IO_PASSWORD }}
registry: quay.io
- name: Buildah Action
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_REPO }}
tags: ${{ env.IMAGE_TAGS }}
dockerfiles: ./Dockerfile
- name: Push to quay.io
id: push-image
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.IMAGE_REGISTRY }}
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
- name: Sign image with GitHub OIDC Token
run: cosign sign --yes ${IMAGE_REGISTRY}/${IMAGE_REPO}@${DIGEST}
env:
DIGEST: ${{ steps.push-image.outputs.digest }}
- name: Generate and store SBOM
run: |
syft "${IMAGE_REGISTRY}/${IMAGE_REPO}@${DIGEST}" -o spdx-json=sbom-spdx.json
cosign attest --yes --predicate sbom-spdx.json --type spdx "${IMAGE_REGISTRY}/${IMAGE_REPO}@${DIGEST}"
env:
DIGEST: ${{ steps.push-image.outputs.digest }}
provenance:
needs: [build]
permissions:
actions: read # for detecting the Github Actions environment.
id-token: write # for creating OIDC tokens for signing.
packages: write # for uploading attestations.
if: ${{ github.ref == 'refs/heads/master' }}
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
image: ${{ needs.build.outputs.image }}
digest: ${{ needs.build.outputs.digest }}
registry-username: ${{ vars.REGISTRY_QUAY_IO_USER }}
secrets:
registry-password: ${{ secrets.REGISTRY_QUAY_IO_PASSWORD }}