Skip to content

Commit c3d93f1

Browse files
gh-variable: add page (#18401)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 431df92 commit c3d93f1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

pages/common/gh-variable.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# gh variable
2+
3+
> Manage GitHub Actions and Dependabot variables.
4+
> More information: <https://cli.github.com/manual/gh_variable>.
5+
6+
- List variables for the current repository:
7+
8+
`gh variable {{[ls|list]}}`
9+
10+
- List variables for a specific organization:
11+
12+
`gh variable {{[ls|list]}} {{[-o|--org]}} {{organization}}`
13+
14+
- Get a variable for the current repository:
15+
16+
`gh variable get {{name}}`
17+
18+
- Set a variable for the current repository (user will be prompted for the value):
19+
20+
`gh variable set {{name}}`
21+
22+
- Set a variable for a deployment environment in the current repository:
23+
24+
`gh variable set {{name}} {{[-e|--env]}} {{environment_name}}`
25+
26+
- Set an organization variable visible to all repositories:
27+
28+
`gh variable set {{name}} {{[-o|--org]}} {{organization}} {{[-v|--visibility]}} all`
29+
30+
- Set multiple variables from a dotenv file:
31+
32+
`gh variable set {{[-f|--env-file]}} {{path/to/file.env}}`
33+
34+
- Delete a variable for the current repository:
35+
36+
`gh variable delete {{name}}`

0 commit comments

Comments
 (0)