GitHub v3 REST API

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.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}

Path Parameters

ownerstringrequired
repostringrequired
artifact_idintegerrequired

artifact_id parameter

archive_formatstringrequired

Response

302

Response

get/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
 
302

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.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/jobs/{job_id}

Path Parameters

ownerstringrequired
repostringrequired
job_idintegerrequired

job_id parameter

Response

200 application/json

Response

Job

Information of a job execution in a workflow run

idintegerrequired

The id of the job.

Example:21

run_idintegerrequired

The id of the associated workflow run.

Example:5

run_urlstringrequired

Example:https://api.github.com/repos/github/hello-world/actions/runs/5

run_attemptinteger

Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.

Example:1

node_idstringrequired

Example:MDg6Q2hlY2tSdW40

head_shastringrequired

The SHA of the commit that is being run.

Example:009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d

urlstringrequired

Example:https://api.github.com/repos/github/hello-world/actions/jobs/21

html_urlstring | nullrequired

Example:https://github.com/github/hello-world/runs/4

statusstringrequired

The phase of the lifecycle that the job is currently in.

Allowed values:queuedin_progresscompleted

Example:queued

conclusionstring | nullrequired

The outcome of the job.

Example:success

started_atstring(date-time)required

The time that the job started, in ISO 8601 format.

Example:2019-08-08T08:00:00-07:00

completed_atstring | null(date-time)required

The time that the job finished, in ISO 8601 format.

Example:2019-08-08T08:00:00-07:00

namestringrequired

The name of the job.

Example:test-coverage

stepsarray[object]

Steps in this job.

Show Child Parameters
check_run_urlstringrequired

Example:https://api.github.com/repos/github/hello-world/check-runs/4

get/repos/{owner}/{repo}/actions/jobs/{job_id}
 
200 application/json

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.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/jobs/{job_id}/logs

Path Parameters

ownerstringrequired
repostringrequired
job_idintegerrequired

job_id parameter

Response

302

Response

get/repos/{owner}/{repo}/actions/jobs/{job_id}/logs
 
302

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.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/permissions

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

actions-repository-permissions

enabledbooleanrequired

Whether GitHub Actions is enabled on the repository.

allowed_actionsstring

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

Allowed values:alllocal_onlyselected

selected_actions_urlstring

The API URL to use to get or set the actions that are allowed to run, when allowed_actions is set to selected.

get/repos/{owner}/{repo}/actions/permissions
 
200 application/json

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.

put
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/permissions

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
enabledbooleanrequired

Whether GitHub Actions is enabled on the repository.

allowed_actionsstring

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

Allowed values:alllocal_onlyselected

Response

204

Response

put/repos/{owner}/{repo}/actions/permissions

Body

{ "enabled": true, "allowed_actions": "selected" }
 
204