Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
outputs:
release-tag: ${{ steps.release-info.outputs.release-tag }}
release-url: ${{ steps.release-info.outputs.release-url }}
image-name: ${{ steps.push-docker.outputs.image-name }}
image-digest: ${{ steps.push-docker.outputs.image-digest }}
runs-on: ubuntu-latest
permissions:
contents: write # To publish release notes.
Expand Down Expand Up @@ -153,9 +155,18 @@ jobs:

# Push the Docker image as part of the release pipeline.
- name: Push the Docker image
id: push-docker
env:
RELEASE_TAG: ${{ steps.release-info.outputs.release-tag }}
run: make push-docker
run: |
make push-docker
IMAGE_AND_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE_NAME")
NAME=$(echo "$IMAGE_AND_DIGEST" | cut -d'@' -f1 | cut -d':' -f1)
DIGEST=$(echo "$IMAGE_AND_DIGEST" | cut -d'@' -f2)
{
echo "image-name=${NAME}"
echo "image-digest=${DIGEST}"
} >> "$GITHUB_OUTPUT"

# Generate the Docker image SBOM under the dist/ directory which will be published as part of the release assets.
- name: Generate Docker sbom
Expand Down Expand Up @@ -262,6 +273,21 @@ jobs:
id-token: write # To sign the provenance.
contents: write # To add assets to a release.

# Generate SLSA provenance for the Docker image and push it to the container registry.
provenance-docker:
needs: [release]
permissions:
actions: read # To detect the Github Actions environment.
id-token: write # To create OIDC tokens for signing.
packages: write # To upload provenance.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.6.0
with:
image: ${{ needs.release.outputs.image-name }}
digest: ${{ needs.release.outputs.image-digest }}
registry-username: ${{ github.actor }}
secrets:
registry-password: ${{ secrets.GITHUB_TOKEN }}

# Publish the SLSA provenance as the GitHub release asset.
publish_provenance:
needs: [release, provenance]
Expand Down