commands.sh

gh variable

all

Manage GitHub Actions and Dependabot variables.

More info →

Options (5)

boolean

List variables for the current repository

Example: gh variable {{[ls|list]}}
-o, --orgboolean

List variables for a specific organization

Example: gh variable {{[ls|list]}} {{[-o|--org]}} {{organization}}
-e, --envboolean

Set a variable for a deployment environment in the current repository

Example: gh variable set {{name}} {{[-e|--env]}} {{environment_name}}
-v, --visibilityboolean

Set an organization variable visible to all repositories

Example: gh variable set {{name}} {{[-o|--org]}} {{organization}} {{[-v|--visibility]}} all
-f, --env-fileboolean

Set multiple variables from a dotenv file

Example: gh variable set {{[-f|--env-file]}} {{path/to/file.env}}

Examples (8)

List variables for the current repository

gh variable [ls|list]

List variables for a specific organization

gh variable [ls|list] [-o|--org] organization

Get a variable for the current repository

gh variable get name

Set a variable for the current repository (user will be prompted for the value)

Set a variable for a deployment environment in the current repository

gh variable set name [-e|--env] environment_name

Set an organization variable visible to all repositories

gh variable set name [-o|--org] organization [-v|--visibility] all

Set multiple variables from a dotenv file

gh variable set [-f|--env-file] path/to/file.env

Delete a variable for the current repository

gh variable delete name
made by @shridhargupta | data from tldr-pages