GitHub Actions Attestation Fails - attestations / id-token write
Generating build provenance with actions/attest-build-provenance fails because the job lacks attestations: write (to record the attestation) or id-token: write (to sign it via OIDC).
What this error means
The attestation step fails with a permissions error, unable to create the attestation or to mint the signing token.
Actions log
Error: Failed to persist attestation: Resource not accessible by integration
# missing attestations: write (and/or id-token: write)Common causes
Missing attestations: write
Recording a provenance attestation against the repository requires attestations: write, which the read-only default token lacks.
Missing id-token: write for signing
Provenance signing uses OIDC, so the job also needs id-token: write to obtain the signing identity.
How to fix it
Grant attestations and id-token write
Add both permissions (plus contents: read) to the job that attests a build artifact.
.github/workflows/release.yml
permissions:
attestations: write
id-token: write
contents: read
steps:
- uses: actions/attest-build-provenance@v1
with:
subject-path: dist/app.tar.gzConfirm the subject and scope
- Point subject-path (or subject-name/digest) at the artifact you built.
- Keep the attest step in the same job that produced the artifact.
- Use least-privilege: grant these scopes only on the attesting job.
How to prevent it
- Declare attestations: write and id-token: write on attestation jobs.
- Attest the exact artifact you publish.
- Scope the write permissions to the attesting job only.
Related guides
GitHub Actions OIDC "Not authorized to AssumeRoleWithWebIdentity"Fix GitHub Actions OIDC AssumeRole failures - the token audience (aud) or subject (sub) does not match the cl…
GitHub Actions Pages Deploy Fails - Missing pages: write / id-tokenFix GitHub Actions Pages deployment failures - the job needs pages: write and id-token: write, plus Pages set…
GitHub Actions Cannot Create a Deployment - Missing deployments: writeFix GitHub Actions 403 creating a Deployment or deployment status - the GITHUB_TOKEN needs deployments: write…