fix(provenance): use repo-scoped attestation endpoint#612
Merged
Conversation
The provenance check queried the user-scoped GitHub attestations endpoint
(/users/{owner}/attestations), which only returns attestations for
repositories owned by a user account. For organization-owned repositories
this returns 404, causing false "invalid-provenance-attestation" failures
even when the artifact was correctly attested.
Switch to the repository-scoped endpoint
(/repos/{owner}/{repo}/attestations), which works for both user- and
organization-owned repositories.
Co-authored-by: Cursor <cursoragent@cursor.com>
academo
approved these changes
Jun 10, 2026
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The provenance attestation check fails for plugins published under a GitHub organization, even when the plugin was correctly built with provenance attestation.
The check queried the user-scoped attestations endpoint:
This endpoint only returns attestations for repositories owned by a user account. For organization-owned repositories it returns 404, so the validator reported a false
invalid-provenance-attestation.This switches to the repository-scoped endpoint, which works for both user- and organization-owned repositories:
The repo name is already captured by the existing source-code-reference regex (
matches[2]), so it's just threaded through to the request.Example
kineticadb/grafana-kinetica-datasourcev1.0.5 (org-owned, correctly attested) was failing the check:GET /users/kineticadb/attestations/sha256:<zip-digest>→ 404 (false failure)GET /repos/kineticadb/grafana-kinetica-datasource/attestations/sha256:<zip-digest>→ 200 (attestation found, digest matches)This affected effectively all plugins published under a GitHub org (most vendor plugins); only personal-account repositories worked before.