GitHub v3 REST API

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.

put
{protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets/{secret_name}/repositories

Path Parameters

orgstringrequired
secret_namestringrequired

secret_name parameter

Body

application/json
selected_repository_idsarray[integer]required

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.

Response

204

Response

put/orgs/{org}/actions/secrets/{secret_name}/repositories

Body

{ "selected_repository_ids": [ 64780797 ] }
 
204

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.

put
{protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}

Path Parameters

orgstringrequired
secret_namestringrequired

secret_name parameter

repository_idintegerrequired

Response

No Content when repository was added to the selected list

put/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}
 

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.

delete
{protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}

Path Parameters

orgstringrequired
secret_namestringrequired

secret_name parameter

repository_idintegerrequired

Response

Response when repository was removed from the selected list

delete/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}
 

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.

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

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

total_countintegerrequired
artifactsarray[object]required

An artifact

Show Child Parameters
get/repos/{owner}/{repo}/actions/artifacts
 
200 application/json

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.

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

Path Parameters

ownerstringrequired
repostringrequired
artifact_idintegerrequired

artifact_id parameter

Response

200 application/json

Response

Artifact

An artifact

idintegerrequired

Example:5

node_idstringrequired

Example:MDEwOkNoZWNrU3VpdGU1

namestringrequired

The name of the artifact.

Example:AdventureWorks.Framework

size_in_bytesintegerrequired

The size in bytes of the artifact.

Example:12345

urlstringrequired

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

archive_download_urlstringrequired

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

expiredbooleanrequired

Whether or not the artifact has expired.

created_atstring | null(date-time)required
expires_atstring | null(date-time)required
updated_atstring | null(date-time)required
get/repos/{owner}/{repo}/actions/artifacts/{artifact_id}
 
200 application/json