Skip to content

Commit fbfc550

Browse files
tauhid621github-openapi-botsubatoirachmari
authored
Adding permissions and subcategory for variables APIs (#33699)
Co-authored-by: github-openapi-bot <security+github-openapi-bot@github.com> Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Co-authored-by: Rachael Sewell <rachmari@github.com>
1 parent 6dbe33b commit fbfc550

18 files changed

+5639
-8534882
lines changed

content/rest/actions/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ children:
1818
- /oidc
1919
- /permissions
2020
- /secrets
21+
- /variables
2122
- /self-hosted-runner-groups
2223
- /self-hosted-runners
2324
- /workflow-jobs

content/rest/actions/variables.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: GitHub Actions Variables
3+
allowTitleToDifferFromFilename: true
4+
shortTitle: Variables
5+
intro: 'Use the REST API to interact with variables in {% data variables.product.prodname_actions %}.'
6+
topics:
7+
- API
8+
versions:
9+
fpt: '*'
10+
ghes: '>=3.8'
11+
ghec: '*'
12+
---
13+
14+
## About variables in {% data variables.product.prodname_actions %}
15+
16+
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 %}
17+
18+
{% 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.

content/rest/overview/permissions-required-for-github-apps.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ shortTitle: GitHub App permissions
5858
- [`POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`](/rest/reference/actions#create-a-workflow-dispatch-event) (write)
5959
- [`PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable`](/rest/reference/actions#enable-a-workflow) (write)
6060
{% ifversion fpt or ghec or ghae %}- [`GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing`](/rest/reference/actions#get-workflow-usage) (read){% endif %}
61+
{% ifversion fpt or ghec or ghes > 3.8 %}
62+
- [`GET /repos/{owner}/{repo}/actions/variables`](/rest/reference/actions#list-repository-variables) (read)
63+
- [`GET /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#get-a-repository-variable) (read)
64+
- [`POST /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#create-a-repository-variable) (write)
65+
- [`PATCH /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#update-a-repository-variable) (write)
66+
- [`DELETE /repos/{owner}/{repo}/actions/variables/{variable_name}`](/rest/reference/actions#delete-a-repository-variable) (write)
67+
- [`GET /repositories/{repository_id}/environments/{environment_name}/variables`](/rest/reference/actions#list-environment-variables) (read)
68+
- [`GET /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#get-an-environment-variable) (read)
69+
- [`POST /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#create-an-environment-variable) (write)
70+
- [`PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#update-an-environment-variable) (write)
71+
- [`DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{variable_name}`](/rest/reference/actions#delete-an-environment-variable) (write)
72+
- [`GET /orgs/{org}/actions/variables`](/rest/reference/actions#list-organization-variables) (read)
73+
- [`GET /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#get-an-organization-variable) (read)
74+
- [`POST /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#create-an-organization-variable) (write)
75+
- [`PATCH /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#update-an-organization-variable) (write)
76+
- [`DELETE /orgs/{org}/actions/variables/{variable_name}`](/rest/reference/actions#delete-an-organization-variable) (write)
77+
- [`GET /orgs/{org}/actions/variables/{variable_name}/repositories`](/rest/reference/actions#list-selected-repositories-for-an-organization-variable) (read)
78+
- [`PUT /orgs/{org}/actions/variables/{variable_name}/repositories`](/rest/reference/actions#set-selected-repositories-for-an-organization-variable) (write)
79+
- [`PUT /orgs/{org}/actions/variables/{variable_name}/repositories/{repository_id}`](/rest/reference/actions#add-selected-repository-to-an-organization-variable) (write)
80+
- [`DELETE /orgs/{org}/actions/variables/{variable_name}/repositories/{repository_id}`](/rest/reference/actions#remove-selected-repository-from-an-organization-variable) (write)
81+
{% endif %}
6182

6283
## Administration
6384

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Variables allow you to store non-sensitive information, such as a username, in your repository, repository environments, or organization.

lib/redirects/static/client-side-rest-api-redirects.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@
323323
"/rest/actions#set-selected-repositories-for-an-organization-secret": "/rest/actions/secrets#set-selected-repositories-for-an-organization-secret",
324324
"/rest/actions#add-selected-repository-to-an-organization-secret": "/rest/actions/secrets#add-selected-repository-to-an-organization-secret",
325325
"/rest/actions#remove-selected-repository-from-an-organization-secret": "/rest/actions/secrets#remove-selected-repository-from-an-organization-secret",
326+
"/rest/actions/variables#list-organization-variables": "/rest/actions/variables#list-organization-variables",
327+
"/rest/actions#variables": "/rest/actions/variables",
328+
"/rest/actions/variables#create-an-organization-variable": "/rest/actions/variables#create-an-organization-variable",
329+
"/rest/actions/variables#get-an-organization-variable": "/rest/actions/variables#get-an-organization-variable",
330+
"/rest/actions/variables#update-an-organization-variable": "/rest/actions/variables#update-an-organization-variable",
331+
"/rest/actions/variables#delete-an-organization-variable": "/rest/actions/variables#delete-an-organization-variable",
332+
"/rest/actions/variables#list-selected-repositories-for-an-organization-variable": "/rest/actions/variables#list-selected-repositories-for-an-organization-variable",
333+
"/rest/actions/variables#set-selected-repositories-for-an-organization-variable": "/rest/actions/variables#set-selected-repositories-for-an-organization-variable",
334+
"/rest/actions/variables#add-selected-repository-to-an-organization-variable": "/rest/actions/variables#add-selected-repository-to-an-organization-variable",
335+
"/rest/actions/variables#remove-selected-repository-from-an-organization-variable": "/rest/actions/variables#remove-selected-repository-from-an-organization-variable",
326336
"/rest/orgs#list-users-blocked-by-an-organization": "/rest/orgs/blocking#list-users-blocked-by-an-organization",
327337
"/rest/orgs#blocking": "/rest/orgs/blocking",
328338
"/rest/orgs#check-if-a-user-is-blocked-by-an-organization": "/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization",
@@ -532,6 +542,11 @@
532542
"/rest/actions#get-a-repository-secret": "/rest/actions/secrets#get-a-repository-secret",
533543
"/rest/actions#create-or-update-a-repository-secret": "/rest/actions/secrets#create-or-update-a-repository-secret",
534544
"/rest/actions#delete-a-repository-secret": "/rest/actions/secrets#delete-a-repository-secret",
545+
"/rest/actions/variables#list-repository-variables": "/rest/actions/variables#list-repository-variables",
546+
"/rest/actions/variables#create-a-repository-variable": "/rest/actions/variables#create-a-repository-variable",
547+
"/rest/actions/variables#get-a-repository-variable": "/rest/actions/variables#get-a-repository-variable",
548+
"/rest/actions/variables#update-a-repository-variable": "/rest/actions/variables#update-a-repository-variable",
549+
"/rest/actions/variables#delete-a-repository-variable": "/rest/actions/variables#delete-a-repository-variable",
535550
"/rest/actions#list-repository-workflows": "/rest/actions/workflows#list-repository-workflows",
536551
"/rest/actions#workflows": "/rest/actions/workflows",
537552
"/rest/actions#get-a-workflow": "/rest/actions/workflows#get-a-workflow",
@@ -842,6 +857,11 @@
842857
"/rest/actions#get-an-environment-secret": "/rest/actions/secrets#get-an-environment-secret",
843858
"/rest/actions#create-or-update-an-environment-secret": "/rest/actions/secrets#create-or-update-an-environment-secret",
844859
"/rest/actions#delete-an-environment-secret": "/rest/actions/secrets#delete-an-environment-secret",
860+
"/rest/actions/variables#list-environment-variables": "/rest/actions/variables#list-environment-variables",
861+
"/rest/actions/variables#create-an-environment-variable": "/rest/actions/variables#create-an-environment-variable",
862+
"/rest/actions/variables#get-an-environment-variable": "/rest/actions/variables#get-an-environment-variable",
863+
"/rest/actions/variables#update-an-environment-variable": "/rest/actions/variables#update-an-environment-variable",
864+
"/rest/actions/variables#delete-an-environment-variable": "/rest/actions/variables#delete-an-environment-variable",
845865
"/rest/teams/#get-a-team-legacy": "/rest/teams/teams#get-a-team-legacy",
846866
"/rest/teams/#update-a-team-legacy": "/rest/teams/teams#update-a-team-legacy",
847867
"/rest/teams/#delete-a-team-legacy": "/rest/teams/teams#delete-a-team-legacy",

lib/rest/static/apps/enabled-for-apps.json

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,60 @@
295295
"verb": "delete",
296296
"requestPath": "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
297297
},
298+
{
299+
"slug": "list-organization-variables",
300+
"subcategory": "variables",
301+
"verb": "get",
302+
"requestPath": "/orgs/{org}/actions/variables"
303+
},
304+
{
305+
"slug": "create-an-organization-variable",
306+
"subcategory": "variables",
307+
"verb": "post",
308+
"requestPath": "/orgs/{org}/actions/variables"
309+
},
310+
{
311+
"slug": "get-an-organization-variable",
312+
"subcategory": "variables",
313+
"verb": "get",
314+
"requestPath": "/orgs/{org}/actions/variables/{name}"
315+
},
316+
{
317+
"slug": "update-an-organization-variable",
318+
"subcategory": "variables",
319+
"verb": "patch",
320+
"requestPath": "/orgs/{org}/actions/variables/{name}"
321+
},
322+
{
323+
"slug": "delete-an-organization-variable",
324+
"subcategory": "variables",
325+
"verb": "delete",
326+
"requestPath": "/orgs/{org}/actions/variables/{name}"
327+
},
328+
{
329+
"slug": "list-selected-repositories-for-an-organization-variable",
330+
"subcategory": "variables",
331+
"verb": "get",
332+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
333+
},
334+
{
335+
"slug": "set-selected-repositories-for-an-organization-variable",
336+
"subcategory": "variables",
337+
"verb": "put",
338+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
339+
},
340+
{
341+
"slug": "add-selected-repository-to-an-organization-variable",
342+
"subcategory": "variables",
343+
"verb": "put",
344+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
345+
},
346+
{
347+
"slug": "remove-selected-repository-from-an-organization-variable",
348+
"subcategory": "variables",
349+
"verb": "delete",
350+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
351+
},
298352
{
299353
"slug": "list-artifacts-for-a-repository",
300354
"subcategory": "artifacts",
@@ -607,6 +661,36 @@
607661
"verb": "delete",
608662
"requestPath": "/repos/{owner}/{repo}/actions/secrets/{secret_name}"
609663
},
664+
{
665+
"slug": "list-repository-variables",
666+
"subcategory": "variables",
667+
"verb": "get",
668+
"requestPath": "/repos/{owner}/{repo}/actions/variables"
669+
},
670+
{
671+
"slug": "create-a-repository-variable",
672+
"subcategory": "variables",
673+
"verb": "post",
674+
"requestPath": "/repos/{owner}/{repo}/actions/variables"
675+
},
676+
{
677+
"slug": "get-a-repository-variable",
678+
"subcategory": "variables",
679+
"verb": "get",
680+
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
681+
},
682+
{
683+
"slug": "update-a-repository-variable",
684+
"subcategory": "variables",
685+
"verb": "patch",
686+
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
687+
},
688+
{
689+
"slug": "delete-a-repository-variable",
690+
"subcategory": "variables",
691+
"verb": "delete",
692+
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
693+
},
610694
{
611695
"slug": "list-repository-workflows",
612696
"subcategory": "workflows",
@@ -672,6 +756,36 @@
672756
"subcategory": "secrets",
673757
"verb": "delete",
674758
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
759+
},
760+
{
761+
"slug": "list-environment-variables",
762+
"subcategory": "variables",
763+
"verb": "get",
764+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
765+
},
766+
{
767+
"slug": "create-an-environment-variable",
768+
"subcategory": "variables",
769+
"verb": "post",
770+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
771+
},
772+
{
773+
"slug": "get-an-environment-variable",
774+
"subcategory": "variables",
775+
"verb": "get",
776+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
777+
},
778+
{
779+
"slug": "update-an-environment-variable",
780+
"subcategory": "variables",
781+
"verb": "patch",
782+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
783+
},
784+
{
785+
"slug": "delete-an-environment-variable",
786+
"subcategory": "variables",
787+
"verb": "delete",
788+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
675789
}
676790
],
677791
"activity": [
@@ -4090,6 +4204,60 @@
40904204
"verb": "delete",
40914205
"requestPath": "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
40924206
},
4207+
{
4208+
"slug": "list-organization-variables",
4209+
"subcategory": "variables",
4210+
"verb": "get",
4211+
"requestPath": "/orgs/{org}/actions/variables"
4212+
},
4213+
{
4214+
"slug": "create-an-organization-variable",
4215+
"subcategory": "variables",
4216+
"verb": "post",
4217+
"requestPath": "/orgs/{org}/actions/variables"
4218+
},
4219+
{
4220+
"slug": "get-an-organization-variable",
4221+
"subcategory": "variables",
4222+
"verb": "get",
4223+
"requestPath": "/orgs/{org}/actions/variables/{name}"
4224+
},
4225+
{
4226+
"slug": "update-an-organization-variable",
4227+
"subcategory": "variables",
4228+
"verb": "patch",
4229+
"requestPath": "/orgs/{org}/actions/variables/{name}"
4230+
},
4231+
{
4232+
"slug": "delete-an-organization-variable",
4233+
"subcategory": "variables",
4234+
"verb": "delete",
4235+
"requestPath": "/orgs/{org}/actions/variables/{name}"
4236+
},
4237+
{
4238+
"slug": "list-selected-repositories-for-an-organization-variable",
4239+
"subcategory": "variables",
4240+
"verb": "get",
4241+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
4242+
},
4243+
{
4244+
"slug": "set-selected-repositories-for-an-organization-variable",
4245+
"subcategory": "variables",
4246+
"verb": "put",
4247+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories"
4248+
},
4249+
{
4250+
"slug": "add-selected-repository-to-an-organization-variable",
4251+
"subcategory": "variables",
4252+
"verb": "put",
4253+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
4254+
},
4255+
{
4256+
"slug": "remove-selected-repository-from-an-organization-variable",
4257+
"subcategory": "variables",
4258+
"verb": "delete",
4259+
"requestPath": "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
4260+
},
40934261
{
40944262
"slug": "list-artifacts-for-a-repository",
40954263
"subcategory": "artifacts",
@@ -4402,6 +4570,36 @@
44024570
"verb": "delete",
44034571
"requestPath": "/repos/{owner}/{repo}/actions/secrets/{secret_name}"
44044572
},
4573+
{
4574+
"slug": "list-repository-variables",
4575+
"subcategory": "variables",
4576+
"verb": "get",
4577+
"requestPath": "/repos/{owner}/{repo}/actions/variables"
4578+
},
4579+
{
4580+
"slug": "create-a-repository-variable",
4581+
"subcategory": "variables",
4582+
"verb": "post",
4583+
"requestPath": "/repos/{owner}/{repo}/actions/variables"
4584+
},
4585+
{
4586+
"slug": "get-a-repository-variable",
4587+
"subcategory": "variables",
4588+
"verb": "get",
4589+
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
4590+
},
4591+
{
4592+
"slug": "update-a-repository-variable",
4593+
"subcategory": "variables",
4594+
"verb": "patch",
4595+
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
4596+
},
4597+
{
4598+
"slug": "delete-a-repository-variable",
4599+
"subcategory": "variables",
4600+
"verb": "delete",
4601+
"requestPath": "/repos/{owner}/{repo}/actions/variables/{name}"
4602+
},
44054603
{
44064604
"slug": "list-repository-workflows",
44074605
"subcategory": "workflows",
@@ -4467,6 +4665,36 @@
44674665
"subcategory": "secrets",
44684666
"verb": "delete",
44694667
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
4668+
},
4669+
{
4670+
"slug": "list-environment-variables",
4671+
"subcategory": "variables",
4672+
"verb": "get",
4673+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
4674+
},
4675+
{
4676+
"slug": "create-an-environment-variable",
4677+
"subcategory": "variables",
4678+
"verb": "post",
4679+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables"
4680+
},
4681+
{
4682+
"slug": "get-an-environment-variable",
4683+
"subcategory": "variables",
4684+
"verb": "get",
4685+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
4686+
},
4687+
{
4688+
"slug": "update-an-environment-variable",
4689+
"subcategory": "variables",
4690+
"verb": "patch",
4691+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
4692+
},
4693+
{
4694+
"slug": "delete-an-environment-variable",
4695+
"subcategory": "variables",
4696+
"verb": "delete",
4697+
"requestPath": "/repositories/{repository_id}/environments/{environment_name}/variables/{name}"
44704698
}
44714699
],
44724700
"activity": [

0 commit comments

Comments
 (0)