Add selected repository to an organization secret

Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.addSelectedRepoToOrgSecret({
org,
secret_name,
repository_id,
});
Parameters
namerequireddescription
orgyes
secret_nameyes

secret_name parameter

repository_idyes

See also: GitHub Developer Guide documentation.

Cancel a workflow run

Cancels a workflow run using its id. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.cancelWorkflowRun({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Create or update an organization secret

Creates or updates an organization secret with an encrypted value. Encrypt your secret usingLibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the tweetsodium library.

const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);

Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")

Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));

Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
octokit.actions.createOrUpdateOrgSecret({
org,
secret_name,
});

Parameters

namerequireddescription
orgyes
secret_nameyes

secret_name parameter

encrypted_valueno

Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an organization public key endpoint.

key_idno

ID of the key you used to encrypt the secret.

visibilityno

Configures the access that repositories have to the organization secret. Can be one of: - all - All repositories in an organization can access the secret. - private - Private repositories in an organization can access the secret. - selected - Only specific repositories can access the secret.

selected_repository_idsno

An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the visibility is set to selected. You can manage the list of selected repositories using the List selected repositories for an organization secret, Set selected repositories for an organization secret, and Remove selected repository from an organization secret endpoints.

See also: GitHub Developer Guide documentation.

Create or update a repository secret

Creates or updates a repository secret with an encrypted value. Encrypt your secret usingLibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the tweetsodium library.

const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);

Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")

Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));

Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
octokit.actions.createOrUpdateRepoSecret({
owner,
repo,
secret_name,
});

Parameters

namerequireddescription
owneryes
repoyes
secret_nameyes

secret_name parameter

encrypted_valueno

Value for your secret, encrypted with LibSodium using the public key retrieved from the Get a repository public key endpoint.

key_idno

ID of the key you used to encrypt the secret.

See also: GitHub Developer Guide documentation.

Create a registration token for an organization

Returns a token that you can pass to the config script. The token expires after one hour.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Example using registration token

Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.

./config.sh --url https://github.com/octo-org --token TOKEN
octokit.actions.createRegistrationTokenForOrg({
org,
});

Parameters

namerequireddescription
orgyes

See also: GitHub Developer Guide documentation.

Create a registration token for a repository

Returns a token that you can pass to the config script. The token expires after one hour. You must authenticate using an access token with the repo scope to use this endpoint.

Example using registration token

Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.

./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN
octokit.actions.createRegistrationTokenForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

Create a remove token for an organization

Returns a token that you can pass to the config script to remove a self-hosted runner from an organization. The token expires after one hour.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from an organization, replace TOKEN with the remove token provided by this endpoint.

./config.sh remove --token TOKEN
octokit.actions.createRemoveTokenForOrg({
org,
});

Parameters

namerequireddescription
orgyes

See also: GitHub Developer Guide documentation.

Create a remove token for a repository

Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the repo scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.

./config.sh remove --token TOKEN
octokit.actions.createRemoveTokenForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

Create a workflow dispatch event

You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs. The inputs are configured in the workflow file. For more information about how to configure the workflow_dispatch event in the workflow file, see "Events that trigger workflows."

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. For more information, see "Creating a personal access token for the command line."

octokit.actions.createWorkflowDispatch({
owner,
repo,
workflow_id,
ref,
});
Parameters
namerequireddescription
owneryes
repoyes
workflow_idyes

The ID of the workflow. You can also pass the workflow file name as a string.

refyes

The git reference for the workflow. The reference can be a branch or tag name.

inputsno

Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.

inputs.*no

See also: GitHub Developer Guide documentation.

Delete an artifact

Deletes an artifact for a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.deleteArtifact({
owner,
repo,
artifact_id,
});
Parameters
namerequireddescription
owneryes
repoyes
artifact_idyes

artifact_id parameter

See also: GitHub Developer Guide documentation.

Delete an organization secret

Deletes a secret in an organization using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.deleteOrgSecret({
org,
secret_name,
});
Parameters
namerequireddescription
orgyes
secret_nameyes

secret_name parameter

See also: GitHub Developer Guide documentation.

Delete a repository secret

Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

octokit.actions.deleteRepoSecret({
owner,
repo,
secret_name,
});
Parameters
namerequireddescription
owneryes
repoyes
secret_nameyes

secret_name parameter

See also: GitHub Developer Guide documentation.

Delete a self-hosted runner from an organization

Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the admin:org scope to use this endpoint.

octokit.actions.deleteSelfHostedRunnerFromOrg({
org,
runner_id,
});
Parameters
namerequireddescription
orgyes
runner_idyes

Unique identifier of the self-hosted runner.

See also: GitHub Developer Guide documentation.

Delete a self-hosted runner from a repository

Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the reposcope to use this endpoint.

octokit.actions.deleteSelfHostedRunnerFromRepo({
owner,
repo,
runner_id,
});
Parameters
namerequireddescription
owneryes
repoyes
runner_idyes

Unique identifier of the self-hosted runner.

See also: GitHub Developer Guide documentation.

Delete a workflow run

Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.deleteWorkflowRun({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Delete workflow run logs

Deletes all logs for a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.deleteWorkflowRunLogs({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Disable a selected repository for GitHub Actions in an organization

Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.disableSelectedRepositoryGithubActionsOrganization({
org,
repository_id,
});
Parameters
namerequireddescription
orgyes
repository_idyes

See also: GitHub Developer Guide documentation.

Disable a workflow

Disables a workflow and sets the state of the workflow to disabled_manually. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.disableWorkflow({
owner,
repo,
workflow_id,
});
Parameters
namerequireddescription
owneryes
repoyes
workflow_idyes

The ID of the workflow. You can also pass the workflow file name as a string.

See also: GitHub Developer Guide documentation.

Download an artifact

Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for Location: in the response header to find the URL for the download. The :archive_format must be zip. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.downloadArtifact({
owner,
repo,
artifact_id,
archive_format,
});
Parameters
namerequireddescription
owneryes
repoyes
artifact_idyes

artifact_id parameter

archive_formatyes

See also: GitHub Developer Guide documentation.

Download job logs for a workflow run

Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for Location: in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.downloadJobLogsForWorkflowRun({
owner,
repo,
job_id,
});
Parameters
namerequireddescription
owneryes
repoyes
job_idyes

job_id parameter

See also: GitHub Developer Guide documentation.

Download workflow run logs

Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look forLocation: in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.downloadWorkflowRunLogs({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Enable a selected repository for GitHub Actions in an organization

Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.enableSelectedRepositoryGithubActionsOrganization({
org,
repository_id,
});
Parameters
namerequireddescription
orgyes
repository_idyes

See also: GitHub Developer Guide documentation.

Enable a workflow

Enables a workflow and sets the state of the workflow to active. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.enableWorkflow({
owner,
repo,
workflow_id,
});
Parameters
namerequireddescription
owneryes
repoyes
workflow_idyes

The ID of the workflow. You can also pass the workflow file name as a string.

See also: GitHub Developer Guide documentation.

Get allowed actions for an organization

Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization.""

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.getAllowedActionsOrganization({
org,
});
Parameters
namerequireddescription
orgyes

See also: GitHub Developer Guide documentation.

Get allowed actions for a repository

Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for a repository."

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

octokit.actions.getAllowedActionsRepository({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

Get an artifact

Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.getArtifact({
owner,
repo,
artifact_id,
});
Parameters
namerequireddescription
owneryes
repoyes
artifact_idyes

artifact_id parameter

See also: GitHub Developer Guide documentation.

Get GitHub Actions permissions for an organization

Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.getGithubActionsPermissionsOrganization({
org,
});
Parameters
namerequireddescription
orgyes

See also: GitHub Developer Guide documentation.

Get GitHub Actions permissions for a repository

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

octokit.actions.getGithubActionsPermissionsRepository({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

Get a job for a workflow run

Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.getJobForWorkflowRun({
owner,
repo,
job_id,
});
Parameters
namerequireddescription
owneryes
repoyes
job_idyes

job_id parameter

See also: GitHub Developer Guide documentation.

Get an organization public key

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.getOrgPublicKey({
org,
});
Parameters
namerequireddescription
orgyes

See also: GitHub Developer Guide documentation.

Get an organization secret

Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.getOrgSecret({
org,
secret_name,
});
Parameters
namerequireddescription
orgyes
secret_nameyes

secret_name parameter

See also: GitHub Developer Guide documentation.

Get GitHub Actions permissions for a repository

Deprecated: This method has been renamed to actions.getGithubActionsPermissionsRepository

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

octokit.actions.getRepoPermissions({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

Get a repository public key

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the secrets repository permission to use this endpoint.

octokit.actions.getRepoPublicKey({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

Get a repository secret

Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

octokit.actions.getRepoSecret({
owner,
repo,
secret_name,
});
Parameters
namerequireddescription
owneryes
repoyes
secret_nameyes

secret_name parameter

See also: GitHub Developer Guide documentation.

Get a self-hosted runner for an organization

Gets a specific self-hosted runner configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

octokit.actions.getSelfHostedRunnerForOrg({
org,
runner_id,
});
Parameters
namerequireddescription
orgyes
runner_idyes

Unique identifier of the self-hosted runner.

See also: GitHub Developer Guide documentation.

Get a self-hosted runner for a repository

Gets a specific self-hosted runner configured in a repository.

You must authenticate using an access token with the repo scope to use this endpoint.

octokit.actions.getSelfHostedRunnerForRepo({
owner,
repo,
runner_id,
});
Parameters
namerequireddescription
owneryes
repoyes
runner_idyes

Unique identifier of the self-hosted runner.

See also: GitHub Developer Guide documentation.

Get a workflow

Gets a specific workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.getWorkflow({
owner,
repo,
workflow_id,
});
Parameters
namerequireddescription
owneryes
repoyes
workflow_idyes

The ID of the workflow. You can also pass the workflow file name as a string.

See also: GitHub Developer Guide documentation.

Get a workflow run

Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.getWorkflowRun({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Get workflow run usage

Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".

Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.getWorkflowRunUsage({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Get workflow usage

Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".

You can replace workflow_id with the workflow file name. For example, you could use main.yaml. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.getWorkflowUsage({
owner,
repo,
workflow_id,
});
Parameters
namerequireddescription
owneryes
repoyes
workflow_idyes

The ID of the workflow. You can also pass the workflow file name as a string.

See also: GitHub Developer Guide documentation.

List artifacts for a repository

Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.listArtifactsForRepo({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List jobs for a workflow run

Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

octokit.actions.listJobsForWorkflowRun({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes
filterno

Filters jobs by their completed_at timestamp. Can be one of: * latest: Returns jobs from the most recent execution of the workflow run. * all: Returns all jobs for a workflow run, including from old executions of the workflow run.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List organization secrets

Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.listOrgSecrets({
org,
});
Parameters
namerequireddescription
orgyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List repository secrets

Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

octokit.actions.listRepoSecrets({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List repository workflows

Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.listRepoWorkflows({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List runner applications for an organization

Lists binaries for the runner application that you can download and run.

You must authenticate using an access token with the admin:org scope to use this endpoint.

octokit.actions.listRunnerApplicationsForOrg({
org,
});
Parameters
namerequireddescription
orgyes

See also: GitHub Developer Guide documentation.

List runner applications for a repository

Lists binaries for the runner application that you can download and run.

You must authenticate using an access token with the repo scope to use this endpoint.

octokit.actions.listRunnerApplicationsForRepo({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes

See also: GitHub Developer Guide documentation.

List selected repositories for an organization secret

Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.listSelectedReposForOrgSecret({
org,
secret_name,
});
Parameters
namerequireddescription
orgyes
secret_nameyes

secret_name parameter

See also: GitHub Developer Guide documentation.

List selected repositories enabled for GitHub Actions in an organization

Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.listSelectedRepositoriesEnabledGithubActionsOrganization({
org,
});
Parameters
namerequireddescription
orgyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List self-hosted runners for an organization

Lists all self-hosted runners configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

octokit.actions.listSelfHostedRunnersForOrg({
org,
});
Parameters
namerequireddescription
orgyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List self-hosted runners for a repository

Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the repo scope to use this endpoint.

octokit.actions.listSelfHostedRunnersForRepo({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List workflow run artifacts

Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.listWorkflowRunArtifacts({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List workflow runs

List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope.

octokit.actions.listWorkflowRuns({
owner,
repo,
workflow_id,
});
Parameters
namerequireddescription
owneryes
repoyes
workflow_idyes

The ID of the workflow. You can also pass the workflow file name as a string.

actorno

Returns someone's workflow runs. Use the login for the user who created the push associated with the check suite or workflow run.

branchno

Returns workflow runs associated with a branch. Use the name of the branch of the push.

eventno

Returns workflow run triggered by the event you specify. For example, push, pull_request or issue. For more information, see "Events that trigger workflows."

statusno

Returns workflow runs with the check run status or conclusion that you specify. For example, a conclusion can be success or a status can be in_progress. Only GitHub can set a status of waiting or requested. For a list of the possible status and conclusion options, see "Create a check run."

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List workflow runs for a repository

Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

octokit.actions.listWorkflowRunsForRepo({
owner,
repo,
});
Parameters
namerequireddescription
owneryes
repoyes
actorno

Returns someone's workflow runs. Use the login for the user who created the push associated with the check suite or workflow run.

branchno

Returns workflow runs associated with a branch. Use the name of the branch of the push.

eventno

Returns workflow run triggered by the event you specify. For example, push, pull_request or issue. For more information, see "Events that trigger workflows."

statusno

Returns workflow runs with the check run status or conclusion that you specify. For example, a conclusion can be success or a status can be in_progress. Only GitHub can set a status of waiting or requested. For a list of the possible status and conclusion options, see "Create a check run."

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

Remove selected repository from an organization secret

Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.removeSelectedRepoFromOrgSecret({
org,
secret_name,
repository_id,
});
Parameters
namerequireddescription
orgyes
secret_nameyes

secret_name parameter

repository_idyes

See also: GitHub Developer Guide documentation.

Re-run a workflow

Re-runs your workflow run using its id. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

octokit.actions.reRunWorkflow({
owner,
repo,
run_id,
});
Parameters
namerequireddescription
owneryes
repoyes
run_idyes

See also: GitHub Developer Guide documentation.

Set allowed actions for an organization

Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

If the organization belongs to an enterprise that has selected actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.

To use the patterns_allowed setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories in the organization.

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.setAllowedActionsOrganization({
org,
github_owned_allowed,
verified_allowed,
patterns_allowed,
});
Parameters
namerequireddescription
orgyes
github_owned_allowedyes

Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.

verified_allowedyes

Whether actions in GitHub Marketplace from verified creators are allowed. Set to true to allow all GitHub Marketplace actions by verified creators.

patterns_allowedyes

Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."

See also: GitHub Developer Guide documentation.

Set allowed actions for a repository

Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for a repository."

If the repository belongs to an organization or enterprise that has selected actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.

To use the patterns_allowed setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

octokit.actions.setAllowedActionsRepository({
owner,
repo,
github_owned_allowed,
verified_allowed,
patterns_allowed,
});
Parameters
namerequireddescription
owneryes
repoyes
github_owned_allowedyes

Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.

verified_allowedyes

Whether actions in GitHub Marketplace from verified creators are allowed. Set to true to allow all GitHub Marketplace actions by verified creators.

patterns_allowedyes

Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."

See also: GitHub Developer Guide documentation.

Set GitHub Actions permissions for an organization

Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions to selected actions, then you cannot override them for the organization.

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.setGithubActionsPermissionsOrganization({
org,
enabled_repositories,
});
Parameters
namerequireddescription
orgyes
enabled_repositoriesyes

The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: all, none, or selected.

allowed_actionsno

The permissions policy that controls the actions that are allowed to run. Can be one of: all, local_only, or selected.

See also: GitHub Developer Guide documentation.

Set GitHub Actions permissions for a repository

Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.

If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as allowed_actions to selected actions, then you cannot override them for the repository.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

octokit.actions.setGithubActionsPermissionsRepository({
owner,
repo,
enabled,
});
Parameters
namerequireddescription
owneryes
repoyes
enabledyes

Whether GitHub Actions is enabled on the repository.

allowed_actionsno

The permissions policy that controls the actions that are allowed to run. Can be one of: all, local_only, or selected.

See also: GitHub Developer Guide documentation.

Set selected repositories for an organization secret

Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

octokit.actions.setSelectedReposForOrgSecret({
org,
secret_name,
});
Parameters
namerequireddescription
orgyes
secret_nameyes

secret_name parameter

selected_repository_idsno

An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the visibility is set to selected. You can add and remove individual repositories using the Set selected repositories for an organization secret and Remove selected repository from an organization secret endpoints.

See also: GitHub Developer Guide documentation.

Set selected repositories enabled for GitHub Actions in an organization

Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

octokit.actions.setSelectedRepositoriesEnabledGithubActionsOrganization({
org,
selected_repository_ids,
});
Parameters
namerequireddescription
orgyes
selected_repository_idsyes

List of repository IDs to enable for GitHub Actions.

See also: GitHub Developer Guide documentation.