Skip to content

Commit

Permalink
feat: attempt to generate provenance using slsa generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitm123 committed Oct 23, 2022
1 parent 364be76 commit 07b4ce1
Showing 1 changed file with 22 additions and 0 deletions.
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/[email protected]
with:
base64-subjects: "${{ needs.release.outputs.hashes }}"
upload-assets: true
release2:
if: github.repository_owner == 'jenkins-x'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 07b4ce1

Please sign in to comment.