artifacts
Creates, updates, deletes, gets or lists an artifacts resource.
Overview
| Name | artifacts |
| Type | Resource |
| Id | github.actions.artifacts |
Fields
The following fields are returned by SELECT queries:
- get_artifact
- list_workflow_run_artifacts
- list_artifacts_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | The name of the artifact. (example: AdventureWorks.Framework) |
node_id | string | (example: MDEwOkNoZWNrU3VpdGU1) |
archive_download_url | string | (example: https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip) |
created_at | string (date-time) | |
digest | string | The 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) |
expired | boolean | Whether or not the artifact has expired. |
expires_at | string (date-time) | |
size_in_bytes | integer | The size in bytes of the artifact. |
updated_at | string (date-time) | |
url | string | (example: https://api.github.com/repos/github/hello-world/actions/artifacts/5) |
workflow_run | object |
Response
| Name | Datatype | Description |
|---|---|---|
artifacts | array | |
total_count | integer |
Response
| Name | Datatype | Description |
|---|---|---|
artifacts | array | |
total_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_artifact | select | owner, repo, artifact_id | 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. | |
list_workflow_run_artifacts | select | owner, repo, run_id | per_page, page, name, direction | Lists 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_repo | select | owner, repo | per_page, page, name | Lists 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_artifact | delete | owner, repo, artifact_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
artifact_id | integer | The unique identifier of the artifact. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
run_id | integer | The unique identifier of the workflow run. |
direction | string | The direction to sort the results by. |
name | string | The name field of an artifact. When specified, only artifacts with this name will be returned. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_artifact
- list_workflow_run_artifacts
- list_artifacts_for_repo
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
;
Lists 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.
SELECT
artifacts,
total_count
FROM github.actions.artifacts
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND run_id = '{{ run_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND name = '{{ name }}'
AND direction = '{{ direction }}'
;
Lists 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.
SELECT
artifacts,
total_count
FROM github.actions.artifacts
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND name = '{{ name }}'
;
DELETE examples
- delete_artifact
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
;