-
Notifications
You must be signed in to change notification settings - Fork 82
Add SLSA generic generator workflow #6788
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||||||||||
| # This workflow uses actions that are not certified by GitHub. | ||||||||||||||
| # They are provided by a third-party and are governed by | ||||||||||||||
| # separate terms of service, privacy policy, and support | ||||||||||||||
| # documentation. | ||||||||||||||
|
|
||||||||||||||
| # This workflow lets you generate SLSA provenance file for your project. | ||||||||||||||
| # The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements | ||||||||||||||
| # The project is an initiative of the OpenSSF (openssf.org) and is developed at | ||||||||||||||
| # https://github.com/slsa-framework/slsa-github-generator. | ||||||||||||||
| # The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. | ||||||||||||||
| # For more information about SLSA and how it improves the supply-chain, visit slsa.dev. | ||||||||||||||
|
|
||||||||||||||
| name: SLSA generic generator | ||||||||||||||
| on: | ||||||||||||||
| workflow_dispatch: | ||||||||||||||
| release: | ||||||||||||||
| types: [created] | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| build: | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| outputs: | ||||||||||||||
| digests: ${{ steps.hash.outputs.digests }} | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||
|
||||||||||||||
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@v5 |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'Build artifacts' step contains placeholder/example code. The comments indicate this should be replaced with actual build commands (see line 30 comment 'Step 1: Build your artifacts'). Consider adding a clearer TODO or FIXME comment to make it explicit that this needs customization, or provide more specific guidance on what should replace this section.
| # These are some amazing artifacts. | |
| # TODO: Replace the following example commands with your actual build steps. | |
| # These are placeholder artifacts for demonstration purposes. |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ls with a glob pattern can fail if no files match, causing the workflow to fail ungracefully. Consider using a more robust approach like files=$(find . -maxdepth 1 -name 'artifact*' -type f) or add error handling to check if files exist before processing.
| files=$(ls artifact*) | |
| files=$(find . -maxdepth 1 -name 'artifact*' -type f) | |
| if [ -z "$files" ]; then | |
| echo "No artifact files found. Exiting." >&2 | |
| exit 1 | |
| fi |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable name mismatch. The output is set to 'hashes' but line 23 declares the job output as 'digests', which is referenced in line 65. Change 'hashes' to 'digests' to match the expected output name.
| echo "hashes=$(sha256sum $files | base64 -w0)" >> "${GITHUB_OUTPUT}" | |
| echo "digests=$(sha256sum $files | base64 -w0)" >> "${GITHUB_OUTPUT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent runner version. All other workflows in this repository use specific Ubuntu versions like
ubuntu-24.04instead ofubuntu-latest. Using a specific version ensures more predictable and reproducible builds.