Skip to main content

attestations

Creates, updates, deletes, gets or lists an attestations resource.

Overview

Nameattestations
TypeResource
Idgithub.users.attestations

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
repository_idinteger
bundleobjectThe attestation's Sigstore Bundle. Refer to the Sigstore Bundle Specification for more information.
bundle_urlstring
initiatorstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_attestationsselectusername, subject_digestper_page, before, after, predicate_typeList a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the attestations:read permission is required.

Please note: in order to offer meaningful security benefits, an attestation's signature and timestamps must be cryptographically verified, and the identity of the attestation signer must be validated. Attestations can be verified using the GitHub CLI attestation verify command. For more information, see our guide on how to use artifact attestations to establish a build's provenance.
delete_attestations_by_subject_digestdeleteusername, subject_digestDelete an artifact attestation by subject digest.
delete_attestations_by_iddeleteusername, attestation_idDelete an artifact attestation by unique ID that is associated with a repository owned by a user.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
attestation_idintegerAttestation ID
subject_digeststringSubject Digest
usernamestringThe handle for the GitHub user account.
afterstringA cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."
beforestringA cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
predicate_typestringOptional filter for fetching attestations with a given predicate type. This option accepts provenance, sbom, release, or freeform text for custom predicate types.

SELECT examples

List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the attestations:read permission is required.

Please note: in order to offer meaningful security benefits, an attestation's signature and timestamps must be cryptographically verified, and the identity of the attestation signer must be validated. Attestations can be verified using the GitHub CLI attestation verify command. For more information, see our guide on how to use artifact attestations to establish a build's provenance.

SELECT
repository_id,
bundle,
bundle_url,
initiator
FROM github.users.attestations
WHERE username = '{{ username }}' -- required
AND subject_digest = '{{ subject_digest }}' -- required
AND per_page = '{{ per_page }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
AND predicate_type = '{{ predicate_type }}'
;

DELETE examples

Delete an artifact attestation by subject digest.

DELETE FROM github.users.attestations
WHERE username = '{{ username }}' --required
AND subject_digest = '{{ subject_digest }}' --required
;