Skip to content

Commit

Permalink
Adding permissions and subcategory for variables APIs (github#33699)
Browse files Browse the repository at this point in the history
Co-authored-by: github-openapi-bot <[email protected]>
Co-authored-by: github-openapi-bot <[email protected]>
Co-authored-by: Ben Ahmady <[email protected]>
Co-authored-by: Rachael Sewell <[email protected]>
  • Loading branch information
5 people authored Jan 6, 2023
1 parent 6dbe33b commit fbfc550
Show file tree
Hide file tree
Showing 18 changed files with 5,639 additions and 8,534,882 deletions.
1 change: 1 addition & 0 deletions content/rest/actions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ children:
- /oidc
- /permissions
- /secrets
- /variables
- /self-hosted-runner-groups
- /self-hosted-runners
- /workflow-jobs
Expand Down
18 changes: 18 additions & 0 deletions content/rest/actions/variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: GitHub Actions Variables
allowTitleToDifferFromFilename: true
shortTitle: Variables
intro: 'Use the REST API to interact with variables in {% data variables.product.prodname_actions %}.'
topics:
- API
versions:
fpt: '*'
ghes: '>=3.8'
ghec: '*'
---

## About variables in {% data variables.product.prodname_actions %}

You can use the REST API to create, update, delete, and retrieve information about variables that can be used in workflows in {% data variables.product.prodname_actions %}. {% data reusables.actions.about-variables %}

{% data reusables.actions.actions-authentication %} {% data variables.product.prodname_github_apps %} must have the `actions_variables/environments/organization_actions_variables` permission to use these endpoints. Authenticated users must have collaborator access to a repository to create, update, or read variables.
21 changes: 21 additions & 0 deletions content/rest/overview/permissions-required-for-github-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ shortTitle: GitHub App permissions
- [`POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`](/rest/reference/actions#create-a-workflow-dispatch-event) (write)
- [`PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable`](/rest/reference/actions#enable-a-workflow) (write)
{% ifversion fpt or ghec or ghae %}- [`GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing`](/rest/reference/actions#get-workflow-usage) (read){% endif %}
{% ifversion fpt or ghec or ghes > 3.8 %}
- [`GET /repos/{owner}/{repo}/actions/variables`](/rest/reference/actions#list-repository-variables) (read)
- [`GET /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#get-a-repository-variable) (read)
- [`POST /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#create-a-repository-variable) (write)
- [`PATCH /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#update-a-repository-variable) (write)
- [`DELETE /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#delete-a-repository-variable) (write)
- [`GET /repositories/{repository_id}/environments/{environment_name}/variables`](/rest/reference/actions#list-environment-variables) (read)
- [`GET /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#get-an-environment-variable) (read)
- [`POST /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#create-an-environment-variable) (write)
- [`PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#update-an-environment-variable) (write)
- [`DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#delete-an-environment-variable) (write)
- [`GET /orgs/{org}/actions/variables`](/rest/reference/actions#list-organization-variables) (read)
- [`GET /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#get-an-organization-variable) (read)
- [`POST /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#create-an-organization-variable) (write)
- [`PATCH /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#update-an-organization-variable) (write)
- [`DELETE /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#delete-an-organization-variable) (write)
- [`GET /orgs/{org}/actions/variables/{variable_name}/repositories`](/rest/reference/actions#list-selected-repositories-for-an-organization-variable) (read)
- [`PUT /orgs/{org}/actions/variables/{variable_name}/repositories`](/rest/reference/actions#set-selected-repositories-for-an-organization-variable) (write)
- [`PUT /orgs/{org}/actions/variables/{variable_name}/repositories/{repository_id}`](/rest/reference/actions#add-selected-repository-to-an-organization-variable) (write)
- [`DELETE /orgs/{org}/actions/variables/{variable_name}/repositories/{repository_id}`](/rest/reference/actions#remove-selected-repository-from-an-organization-variable) (write)
{% endif %}

## Administration

Expand Down
1 change: 1 addition & 0 deletions data/reusables/actions/about-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Variables allow you to store non-sensitive information, such as a username, in your repository, repository environments, or organization.
20 changes: 20 additions & 0 deletions lib/redirects/static/client-side-rest-api-redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,16 @@
"/rest/actions#set-selected-repositories-for-an-organization-secret": "/rest/actions/secrets#set-selected-repositories-for-an-organization-secret",
"/rest/actions#add-selected-repository-to-an-organization-secret": "/rest/actions/secrets#add-selected-repository-to-an-organization-secret",
"/rest/actions#remove-selected-repository-from-an-organization-secret": "/rest/actions/secrets#remove-selected-repository-from-an-organization-secret",
"/rest/actions/variables#list-organization-variables": "/rest/actions/variables#list-organization-variables",
"/rest/actions#variables": "/rest/actions/variables",
"/rest/actions/variables#create-an-organization-variable": "/rest/actions/variables#create-an-organization-variable",
"/rest/actions/variables#get-an-organization-variable": "/rest/actions/variables#get-an-organization-variable",
"/rest/actions/variables#update-an-organization-variable": "/rest/actions/variables#update-an-organization-variable",
"/rest/actions/variables#delete-an-organization-variable": "/rest/actions/variables#delete-an-organization-variable",
"/rest/actions/variables#list-selected-repositories-for-an-organization-variable": "/rest/actions/variables#list-selected-repositories-for-an-organization-variable",
"/rest/actions/variables#set-selected-repositories-for-an-organization-variable": "/rest/actions/variables#set-selected-repositories-for-an-organization-variable",
"/rest/actions/variables#add-selected-repository-to-an-organization-variable": "/rest/actions/variables#add-selected-repository-to-an-organization-variable",
"/rest/actions/variables#remove-selected-repository-from-an-organization-variable": "/rest/actions/variables#remove-selected-repository-from-an-organization-variable",
"/rest/orgs#list-users-blocked-by-an-organization": "/rest/orgs/blocking#list-users-blocked-by-an-organization",
"/rest/orgs#blocking": "/rest/orgs/blocking",
"/rest/orgs#check-if-a-user-is-blocked-by-an-organization": "/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization",
Expand Down Expand Up @@ -532,6 +542,11 @@
"/rest/actions#get-a-repository-secret": "/rest/actions/secrets#get-a-repository-secret",
"/rest/actions#create-or-update-a-repository-secret": "/rest/actions/secrets#create-or-update-a-repository-secret",
"/rest/actions#delete-a-repository-secret": "/rest/actions/secrets#delete-a-repository-secret",
"/rest/actions/variables#list-repository-variables": "/rest/actions/variables#list-repository-variables",
"/rest/actions/variables#create-a-repository-variable": "/rest/actions/variables#create-a-repository-variable",
"/rest/actions/variables#get-a-repository-variable": "/rest/actions/variables#get-a-repository-variable",
"/rest/actions/variables#update-a-repository-variable": "/rest/actions/variables#update-a-repository-variable",
"/rest/actions/variables#delete-a-repository-variable": "/rest/actions/variables#delete-a-repository-variable",
"/rest/actions#list-repository-workflows": "/rest/actions/workflows#list-repository-workflows",
"/rest/actions#workflows": "/rest/actions/workflows",
"/rest/actions#get-a-workflow": "/rest/actions/workflows#get-a-workflow",
Expand Down Expand Up @@ -842,6 +857,11 @@
"/rest/actions#get-an-environment-secret": "/rest/actions/secrets#get-an-environment-secret",
"/rest/actions#create-or-update-an-environment-secret": "/rest/actions/secrets#create-or-update-an-environment-secret",
"/rest/actions#delete-an-environment-secret": "/rest/actions/secrets#delete-an-environment-secret",
"/rest/actions/variables#list-environment-variables": "/rest/actions/variables#list-environment-variables",
"/rest/actions/variables#create-an-environment-variable": "/rest/actions/variables#create-an-environment-variable",
"/rest/actions/variables#get-an-environment-variable": "/rest/actions/variables#get-an-environment-variable",
"/rest/actions/variables#update-an-environment-variable": "/rest/actions/variables#update-an-environment-variable",
"/rest/actions/variables#delete-an-environment-variable": "/rest/actions/variables#delete-an-environment-variable",
"/rest/teams/#get-a-team-legacy": "/rest/teams/teams#get-a-team-legacy",
"/rest/teams/#update-a-team-legacy": "/rest/teams/teams#update-a-team-legacy",
"/rest/teams/#delete-a-team-legacy": "/rest/teams/teams#delete-a-team-legacy",
Expand Down
228 changes: 228 additions & 0 deletions lib/rest/static/apps/enabled-for-apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,60 @@
"verb": "delete",
"requestPath": "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
},
{
"slug": "list-organization-variables",
"subcategory": "variables",
"verb": "get",
"requestPath": "/orgs/{org}/actions/variables"
},
{
"slug": "create-an-organization-variable",
"subcategory": "variables",
"verb": "post",
"requestPath": "/orgs/{org}/actions/variables"
},
{
"slug": "get-an-organization-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/orgs/{org}/actions/variables/{name}"
},
{
"slug": "update-an-organization-variable",
"subcategory": "variables",
"verb": "patch",
"requestPath": "/orgs/{org}/actions/variables/{name}"
},
{
"slug": "delete-an-organization-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/orgs/{org}/actions/variables/{name}"
},
{
"slug": "list-selected-repositories-for-an-organization-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
},
{
"slug": "set-selected-repositories-for-an-organization-variable",
"subcategory": "variables",
"verb": "put",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
},
{
"slug": "add-selected-repository-to-an-organization-variable",
"subcategory": "variables",
"verb": "put",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
},
{
"slug": "remove-selected-repository-from-an-organization-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
},
{
"slug": "list-artifacts-for-a-repository",
"subcategory": "artifacts",
Expand Down Expand Up @@ -607,6 +661,36 @@
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/actions/secrets/{secret_name}"
},
{
"slug": "list-repository-variables",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/actions/variables"
},
{
"slug": "create-a-repository-variable",
"subcategory": "variables",
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/actions/variables"
},
{
"slug": "get-a-repository-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
},
{
"slug": "update-a-repository-variable",
"subcategory": "variables",
"verb": "patch",
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
},
{
"slug": "delete-a-repository-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
},
{
"slug": "list-repository-workflows",
"subcategory": "workflows",
Expand Down Expand Up @@ -672,6 +756,36 @@
"subcategory": "secrets",
"verb": "delete",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
},
{
"slug": "list-environment-variables",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
},
{
"slug": "create-an-environment-variable",
"subcategory": "variables",
"verb": "post",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
},
{
"slug": "get-an-environment-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
},
{
"slug": "update-an-environment-variable",
"subcategory": "variables",
"verb": "patch",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
},
{
"slug": "delete-an-environment-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
}
],
"activity": [
Expand Down Expand Up @@ -4090,6 +4204,60 @@
"verb": "delete",
"requestPath": "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
},
{
"slug": "list-organization-variables",
"subcategory": "variables",
"verb": "get",
"requestPath": "/orgs/{org}/actions/variables"
},
{
"slug": "create-an-organization-variable",
"subcategory": "variables",
"verb": "post",
"requestPath": "/orgs/{org}/actions/variables"
},
{
"slug": "get-an-organization-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/orgs/{org}/actions/variables/{name}"
},
{
"slug": "update-an-organization-variable",
"subcategory": "variables",
"verb": "patch",
"requestPath": "/orgs/{org}/actions/variables/{name}"
},
{
"slug": "delete-an-organization-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/orgs/{org}/actions/variables/{name}"
},
{
"slug": "list-selected-repositories-for-an-organization-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
},
{
"slug": "set-selected-repositories-for-an-organization-variable",
"subcategory": "variables",
"verb": "put",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
},
{
"slug": "add-selected-repository-to-an-organization-variable",
"subcategory": "variables",
"verb": "put",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
},
{
"slug": "remove-selected-repository-from-an-organization-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
},
{
"slug": "list-artifacts-for-a-repository",
"subcategory": "artifacts",
Expand Down Expand Up @@ -4402,6 +4570,36 @@
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/actions/secrets/{secret_name}"
},
{
"slug": "list-repository-variables",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/actions/variables"
},
{
"slug": "create-a-repository-variable",
"subcategory": "variables",
"verb": "post",
"requestPath": "/repos/{owner}/{repo}/actions/variables"
},
{
"slug": "get-a-repository-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
},
{
"slug": "update-a-repository-variable",
"subcategory": "variables",
"verb": "patch",
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
},
{
"slug": "delete-a-repository-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
},
{
"slug": "list-repository-workflows",
"subcategory": "workflows",
Expand Down Expand Up @@ -4467,6 +4665,36 @@
"subcategory": "secrets",
"verb": "delete",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
},
{
"slug": "list-environment-variables",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
},
{
"slug": "create-an-environment-variable",
"subcategory": "variables",
"verb": "post",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
},
{
"slug": "get-an-environment-variable",
"subcategory": "variables",
"verb": "get",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
},
{
"slug": "update-an-environment-variable",
"subcategory": "variables",
"verb": "patch",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
},
{
"slug": "delete-an-environment-variable",
"subcategory": "variables",
"verb": "delete",
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
}
],
"activity": [
Expand Down
Loading

0 comments on commit fbfc550

Please sign in to comment.