Actions
Endpoints to manage GitHub Actions using the REST API.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /enterprises/{enterprise}/actions/cache/retention-limit | Get GitHub Actions cache retention limit for an enterprise |
PUT | /enterprises/{enterprise}/actions/cache/retention-limit | Set GitHub Actions cache retention limit for an enterprise |
GET | /enterprises/{enterprise}/actions/cache/storage-limit | Get GitHub Actions cache storage limit for an enterprise |
PUT | /enterprises/{enterprise}/actions/cache/storage-limit | Set GitHub Actions cache storage limit for an enterprise |
GET | /organizations/{org}/actions/cache/retention-limit | Get GitHub Actions cache retention limit for an organization |
PUT | /organizations/{org}/actions/cache/retention-limit | Set GitHub Actions cache retention limit for an organization |
GET | /organizations/{org}/actions/cache/storage-limit | Get GitHub Actions cache storage limit for an organization |
PUT | /organizations/{org}/actions/cache/storage-limit | Set GitHub Actions cache storage limit for an organization |
GET | /orgs/{org}/actions/cache/usage | Get GitHub Actions cache usage for an organization |
GET | /orgs/{org}/actions/cache/usage-by-repository | List repositories with GitHub Actions cache usage for an organization |
GET | /orgs/{org}/actions/hosted-runners | List GitHub-hosted runners for an organization |
POST | /orgs/{org}/actions/hosted-runners | Create a GitHub-hosted runner for an organization |
GET | /orgs/{org}/actions/hosted-runners/images/custom | List custom images for an organization |
GET | /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id} | Get a custom image definition for GitHub Actions Hosted Runners |
DELETE | /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id} | Delete a custom image from the organization |
GET | /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions | List image versions of a custom image for an organization |
GET | /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} | Get an image version of a custom image for GitHub Actions Hosted Runners |
DELETE | /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version} | Delete an image version of custom image from the organization |
GET | /orgs/{org}/actions/hosted-runners/images/github-owned | Get GitHub-owned images for GitHub-hosted runners in an organization |
GET | /orgs/{org}/actions/hosted-runners/images/partner | Get partner images for GitHub-hosted runners in an organization |
GET | /orgs/{org}/actions/hosted-runners/limits | Get limits on GitHub-hosted runners for an organization |
GET | /orgs/{org}/actions/hosted-runners/machine-sizes | Get GitHub-hosted runners machine specs for an organization |
GET | /orgs/{org}/actions/hosted-runners/platforms | Get platforms for GitHub-hosted runners in an organization |
GET | /orgs/{org}/actions/hosted-runners/{hosted_runner_id} | Get a GitHub-hosted runner for an organization |
PATCH | /orgs/{org}/actions/hosted-runners/{hosted_runner_id} | Update a GitHub-hosted runner for an organization |
DELETE | /orgs/{org}/actions/hosted-runners/{hosted_runner_id} | Delete a GitHub-hosted runner for an organization |
GET | /orgs/{org}/actions/permissions | Get GitHub Actions permissions for an organization |
PUT | /orgs/{org}/actions/permissions | Set GitHub Actions permissions for an organization |
GET | /orgs/{org}/actions/permissions/artifact-and-log-retention | Get artifact and log retention settings for an organization |
PUT | /orgs/{org}/actions/permissions/artifact-and-log-retention | Set artifact and log retention settings for an organization |
GET | /orgs/{org}/actions/permissions/fork-pr-contributor-approval | Get fork PR contributor approval permissions for an organization |
PUT | /orgs/{org}/actions/permissions/fork-pr-contributor-approval | Set fork PR contributor approval permissions for an organization |
GET | /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos | Get private repo fork PR workflow settings for an organization |
PUT | /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos | Set private repo fork PR workflow settings for an organization |
GET | /orgs/{org}/actions/permissions/repositories | List selected repositories enabled for GitHub Actions in an organization |
PUT | /orgs/{org}/actions/permissions/repositories | Set selected repositories enabled for GitHub Actions in an organization |
PUT | /orgs/{org}/actions/permissions/repositories/{repository_id} | Enable a selected repository for GitHub Actions in an organization |
DELETE | /orgs/{org}/actions/permissions/repositories/{repository_id} | Disable a selected repository for GitHub Actions in an organization |
GET | /orgs/{org}/actions/permissions/selected-actions | Get allowed actions and reusable workflows for an organization |
PUT | /orgs/{org}/actions/permissions/selected-actions | Set allowed actions and reusable workflows for an organization |
The full set of 187 operations is in the API reference.
Example
Get GitHub Actions cache retention limit for an enterprise, with the TypeScript SDK:
ts
import { GitHubV3REST } from "github";
const client = new GitHubV3REST({
baseUrl: "https://api.github.com",
});
const result = await client.actions.actionsGetCacheRetentionLimitForEnterprise({
enterprise: "enterprise",
});
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.