artifact_storage_records
Creates, updates, deletes, gets or lists an artifact_storage_records resource.
Overview
| Name | artifact_storage_records |
| Type | Resource |
| Id | github.orgs.artifact_storage_records |
Fields
The following fields are returned by SELECT queries:
- list_artifact_storage_records
Response
| Name | Datatype | Description |
|---|---|---|
storage_records | array | |
total_count | integer | The number of storage records for this digest and organization |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_artifact_storage_records | select | org, subject_digest | List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. The collection of storage records 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 content:read permission is required. | |
create_artifact_storage_record | insert | org, name, digest, registry_url | Create metadata storage records for artifacts associated with an organization. This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and associated with a repository owned by the organization. |
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.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
subject_digest | string | The parameter should be set to the attestation's subject's SHA256 digest, in the form sha256:HEX_DIGEST. (example: sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72) |
SELECT examples
- list_artifact_storage_records
List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization.
The collection of storage records 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 content:read permission is required.
SELECT
storage_records,
total_count
FROM github.orgs.artifact_storage_records
WHERE org = '{{ org }}' -- required
AND subject_digest = '{{ subject_digest }}' -- required
;
INSERT examples
- create_artifact_storage_record
- Manifest
Create metadata storage records for artifacts associated with an organization.
This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and
associated with a repository owned by the organization.
INSERT INTO github.orgs.artifact_storage_records (
name,
digest,
version,
artifact_url,
path,
registry_url,
repository,
status,
github_repository,
return_records,
org
)
SELECT
'{{ name }}' /* required */,
'{{ digest }}' /* required */,
'{{ version }}',
'{{ artifact_url }}',
'{{ path }}',
'{{ registry_url }}' /* required */,
'{{ repository }}',
'{{ status }}',
'{{ github_repository }}',
{{ return_records }},
'{{ org }}'
RETURNING
storage_records,
total_count
;
# Description fields are for documentation purposes
- name: artifact_storage_records
props:
- name: org
value: "{{ org }}"
description: Required parameter for the artifact_storage_records resource.
- name: name
value: "{{ name }}"
description: |
The name of the artifact.
- name: digest
value: "{{ digest }}"
description: |
The digest of the artifact (algorithm:hex-encoded-digest).
- name: version
value: "{{ version }}"
description: |
The artifact version.
- name: artifact_url
value: "{{ artifact_url }}"
description: |
The URL where the artifact is stored.
- name: path
value: "{{ path }}"
description: |
The path of the artifact.
- name: registry_url
value: "{{ registry_url }}"
description: |
The base URL of the artifact registry.
- name: repository
value: "{{ repository }}"
description: |
The repository name within the registry.
- name: status
value: "{{ status }}"
description: |
The status of the artifact (e.g., active, inactive).
valid_values: ['active', 'eol', 'deleted']
default: active
- name: github_repository
value: "{{ github_repository }}"
description: |
The name of the GitHub repository associated with the artifact. This should be used
when there are no provenance attestations available for the artifact. The repository
must belong to the organization specified in the path parameter.
If a provenance attestation is available for the artifact, the API will use
the repository information from the attestation instead of this parameter.
- name: return_records
value: {{ return_records }}
description: |
If true, the endpoint will return the created record in the response body.
default: true