Skip to main content

artifacts

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

Overview

Nameartifacts
TypeResource
Idgithub.actions.artifacts

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
namestringThe name of the artifact. (example: AdventureWorks.Framework)
node_idstring (example: MDEwOkNoZWNrU3VpdGU1)
archive_download_urlstring (example: https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip)
created_atstring (date-time)
digeststringThe SHA256 digest of the artifact. This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. For older versions, this field will be null. (example: sha256:cfc3236bdad15b5898bca8408945c9e19e1917da8704adc20eaa618444290a8c)
expiredbooleanWhether or not the artifact has expired.
expires_atstring (date-time)
size_in_bytesintegerThe size in bytes of the artifact.
updated_atstring (date-time)
urlstring (example: https://api.github.com/repos/github/hello-world/actions/artifacts/5)
workflow_runobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_artifactselectowner, repo, artifact_idGets a specific artifact for a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
list_workflow_run_artifactsselectowner, repo, run_idper_page, page, name, directionLists artifacts for a workflow run.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
list_artifacts_for_reposelectowner, repoper_page, page, nameLists all artifacts for a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
delete_artifactdeleteowner, repo, artifact_idDeletes an artifact for a workflow run.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

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
artifact_idintegerThe unique identifier of the artifact.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
run_idintegerThe unique identifier of the workflow run.
directionstringThe direction to sort the results by.
namestringThe name field of an artifact. When specified, only artifacts with this name will be returned.
pageintegerThe page number of the results to fetch. 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."

SELECT examples

Gets a specific artifact for a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

SELECT
id,
name,
node_id,
archive_download_url,
created_at,
digest,
expired,
expires_at,
size_in_bytes,
updated_at,
url,
workflow_run
FROM github.actions.artifacts
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND artifact_id = '{{ artifact_id }}' -- required
;

DELETE examples

Deletes an artifact for a workflow run.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

DELETE FROM github.actions.artifacts
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND artifact_id = '{{ artifact_id }}' --required
;