Skip to main content

attestations

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

Overview

Nameattestations
TypeResource
Idgithub.orgs.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_attestationsselectorg, subject_digestper_page, before, after, predicate_typeList a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.

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_digestdeleteorg, subject_digestDelete an artifact attestation by subject digest.
delete_attestations_by_iddeleteorg, attestation_idDelete an artifact attestation by unique ID that is associated with a repository owned by an org.
list_attestations_bulkexecorg, subject_digestsper_page, before, afterList a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.

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_bulkexecorg, subject_digests, attestation_idsDelete artifact attestations in bulk by either subject digests or unique ID.

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
orgstringThe organization name. The name is not case sensitive.
subject_digeststringSubject Digest
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 an organization.

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.orgs.attestations
WHERE org = '{{ org }}' -- 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.orgs.attestations
WHERE org = '{{ org }}' --required
AND subject_digest = '{{ subject_digest }}' --required
;

Lifecycle Methods

List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.

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.

EXEC github.orgs.attestations.list_attestations_bulk 
@org='{{ org }}' --required,
@per_page='{{ per_page }}',
@before='{{ before }}',
@after='{{ after }}'
@@json=
'{
"subject_digests": "{{ subject_digests }}",
"predicate_type": "{{ predicate_type }}"
}'
;