Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: attempt to generate provenance using slsa generator #8442

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions .github/workflows/jenkins-x-release.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# provenace generation step is taken from: https://github.com/ko-build/ko/blob/main/.github/workflows/release.yml
name: Release
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
release:
if: github.repository_owner == 'jenkins-x'
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.generate-subject.outputs.hashes }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -38,9 +41,18 @@ jobs:
COSIGN_PWD: ${{secrets.COSIGN_PWD}}
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
name: upload-binaries
id: release-artifacts
uses: docker://ghcr.io/jenkins-x/jx-goreleaser-image:0.0.1@sha256:75dde8a5d24f9e7ec58c8d52beed30af3763ed65071610486eabb424abbe5150
with:
entrypoint: .github/workflows/jenkins-x/upload-binaries.sh
- name: Generate subject
id: generate-subject
env:
ARTIFACTS: "${{ steps.release-artifacts.outputs.artifacts }}"
run: |
set -euo pipefail
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
echo "::set-output name=hashes::$(cat $checksum_file | base64 -w0)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down Expand Up @@ -111,6 +123,16 @@ jobs:
DOCKER_REGISTRY_ORG: jenkins-x
REPO_NAME: ${{ github.event.repository.name }}
VERSION: ${{ steps.prep.outputs.version }}
provenance:
needs: release
permissions:
actions: read # To read the workflow path.
id-token: write # To sign the provenance.
contents: write # To add assets to a release.
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.2.1
with:
base64-subjects: "${{ needs.release.outputs.hashes }}"
upload-assets: true
release2:
if: github.repository_owner == 'jenkins-x'
runs-on: ubuntu-latest
Expand Down