Skip to content

SLSA generic generator #12

SLSA generic generator

SLSA generic generator #12

Workflow file for this run

name: SLSA generic generator
on:
workflow_dispatch:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
outputs:
digests: ${{ steps.generate-hash.outputs.digests }}
steps:
- uses: actions/checkout@v4
# Step 1: Build your artifacts.
- name: Build artifacts
run: |
# Assuming maze0.py is your main script
cp maze0.py artifact1
echo "artifact2" > artifact2
# Step 2: Generate the provenance subjects.
- name: Generate subject for provenance
id: generate-hash
run: |
set -euo pipefail
# List the artifacts the provenance will refer to.
files=$(ls artifact1 artifact2)
# Generate the subjects (base64 encoded).
hashes=$(sha256sum $files | base64 -w0)
echo "hashes=$hashes" >> $GITHUB_ENV
echo "::set-output name=digests::$hashes" # Deprecated but included for compatibility
provenance:
needs: [build]
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.4.0
with:
base64-subjects: "${{ needs.build.outputs.digests }}"
upload-assets: true # Optional: Upload to a new release