cache
Creates, updates, deletes, gets or lists a cache resource.
Overview
| Name | cache |
| Type | Resource |
| Id | github.actions.cache |
Fields
The following fields are returned by SELECT queries:
- get_actions_cache_list
Response
| Name | Datatype | Description |
|---|---|---|
actions_caches | array | Array of caches |
total_count | integer | Total number of caches |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_actions_cache_list | select | owner, repo | per_page, page, ref, key, sort, direction | Lists the GitHub Actions caches for a repository. OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. |
delete_actions_cache_by_id | delete | owner, repo, cache_id | Deletes a GitHub Actions cache for a repository, using a cache ID. OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
delete_actions_cache_by_key | delete | owner, repo, key | ref | Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. 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 |
|---|---|---|
cache_id | integer | The unique identifier of the GitHub Actions cache. |
key | string | A key for identifying the cache. |
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. |
direction | string | The direction to sort the results by. |
key | string | An explicit key or prefix for identifying the cache |
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." |
ref | string | The full Git reference for narrowing down the cache. The ref for a branch should be formatted as refs/heads/<branch name>. To reference a pull request use refs/pull/<number>/merge. |
sort | string | The property to sort the results by. created_at means when the cache was created. last_accessed_at means when the cache was last accessed. size_in_bytes is the size of the cache in bytes. |
SELECT examples
- get_actions_cache_list
Lists the GitHub Actions caches for a repository.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
actions_caches,
total_count
FROM github.actions.cache
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND ref = '{{ ref }}'
AND key = '{{ key }}'
AND sort = '{{ sort }}'
AND direction = '{{ direction }}'
;
DELETE examples
- delete_actions_cache_by_id
- delete_actions_cache_by_key
Deletes a GitHub Actions cache for a repository, using a cache ID.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
DELETE FROM github.actions.cache
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND cache_id = '{{ cache_id }}' --required
;
Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
DELETE FROM github.actions.cache
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND key = '{{ key }}' --required
AND ref = '{{ ref }}'
;