This project is a sample project for testing the attest-build-provenance action in GitHub Actions. It demonstrates how to prove the provenance of build artifacts.
.
├── package.json # Node.js project configuration
├── index.js # Main application code
├── .github/
│ └── workflows/
│ └── attest-build.yml # GitHub Actions workflow
└── README.md # This file
- Cryptographically prove the origin of artifacts generated during the build process
- Comply with SLSA (Supply-chain Levels for Software Artifacts) Provenance standards
- Use Sigstore for signing and transparency log entries
- Support attestation for multiple artifacts in a single workflow
- Generate separate attestation information for each artifact
The following permissions are required to use attest-build-provenance in GitHub Actions:
permissions:
contents: read
id-token: write
attestations: writeThis project runs workflows in the following cases:
- Push to
mainordevelopbranches - Pull requests to
mainbranch - Manual workflow execution (workflow_dispatch)
# Install dependencies
npm install
# Run the application
npm start
# Run tests
npm test
# Run build
npm run build- Push this code to a GitHub repository
- Check workflow execution in the GitHub Actions tab
- Monitor the build and attestation process
After workflow execution, generated attestations can be verified using the GitHub UI or by checking the attestation summary in the workflow logs. The attestations are stored as part of the workflow run and can be accessed through the GitHub attestations API.
A basic example that generates attestation for a single artifact.
- Build Process: Node.js application build
- Artifact Generation: Create
artifact.tar.gzfile - Attestation Generation: Use
actions/attest-build-provenanceaction for attestation - Verification: Output and verify attestation information
An advanced example that generates attestation for multiple artifacts.
- Multiple Artifact Generation: Application and configuration file artifacts
- Multi-Subject Attestation: Use
subjectsparameter for attesting multiple artifacts - Summary: Output summary of generated attestation information
- Identity verification using GitHub Actions OIDC tokens
- Requires
id-token: writepermission
- Temporary certificate issuance using Sigstore's Fulcio
- Log signatures to Rekor transparency log
- Validate attestation certificate authenticity
- Verify build information integrity
-
Permission Errors
Error: Resource not accessible by integration- Check Actions permissions in repository settings
- Verify
id-token: writepermission is granted
-
Attestation Failures
Error: failed to attest build provenance- Verify artifact path is correct
- Ensure digest algorithm matches
-
Signing Errors
Error: failed to sign attestation- Check OIDC token issuance
- Verify Sigstore service status
-
Enable Detailed Logging
- name: Attest build provenance uses: actions/attest-build-provenance@v1 with: subject-path: 'artifact.tar.gz' env: ACTIONS_STEP_DEBUG: true
-
Verify Artifacts
# Check artifact digest sha256sum artifact.tar.gz # Check artifact contents tar -tzf artifact.tar.gz
- GitHub Actions attest-build-provenance Documentation
- SLSA Provenance Specification
- Sigstore Project
- GitHub Actions OIDC
MIT License