LinuxCommandLibrary

gh-variable

Manage GitHub Actions configuration variables

TLDR

List variables

$ gh variable list
copy
Set a variable
$ gh variable set [name] -b "[value]"
copy
Set from file
$ gh variable set [name] < [file]
copy
Delete a variable
$ gh variable delete [name]
copy
Set organization variable
$ gh variable set [name] -o [org] -b "[value]"
copy

SYNOPSIS

gh variable command [options]

DESCRIPTION

gh variable manages GitHub Actions configuration variables for storing non-sensitive workflow data. Unlike secrets, variables are not encrypted and their values can be retrieved, making them suitable for configuration settings, feature flags, and environment names.
Variables can be scoped to repositories, organizations, or specific deployment environments. They are accessible in workflows via the vars context (e.g., `vars.VARIABLE_NAME`). They are ideal for API endpoints, build configurations, and other non-secret parameters.

PARAMETERS

-b, --body value

Variable value.
-R, --repo owner/repo
Repository.
-o, --org name
Organization.
-e, --env name
Environment.

SUBCOMMANDS

list

List variables.
set
Set a variable.
delete
Delete a variable.
get
Get a variable.

SEE ALSO

gh(1), gh-secret(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community