GitHub CLI Issues and Actions/Set repository variable

Create or update a repository variable.

Section: GitHub Actions and Workflows

Set repository variable

bash
bash
gh variable set APP_ENV --body production
Explanation

Create or update a repository variable.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing GitHub Actions and Workflows
List Actions variables
List repository variables.
OpenIn sheetbashsame section
List workflows
List workflows in the current repository.
OpenIn sheetbashsame section
View workflow details
Show details for a workflow.
OpenIn sheetbashsame section
Trigger a workflow
Dispatch a workflow with inputs.
OpenIn sheetbashsame section
Enable a workflow
Enable a disabled workflow.
OpenIn sheetbashsame section
Disable a workflow
Disable a workflow.
OpenIn sheetbashsame section