About
Variables provide a way to store and reuse non-sensitive configuration information. You can store any configuration data such as compiler flags, usernames, or server names as variables. Variables are interpolated on the runner machine that runs your workflow. Commands that run in actions or workflow steps can create, read, and modify variables.
You can set your own custom variables or use the default environment variables that GitHub sets automatically.
You can set a custom variable in two ways.
- To define an environment variable for use in a single workflow, you can use the
env
key in the workflow file. For more information, see Defining environment variables for a single workflow. - To define a configuration variable across multiple workflows, you can define it at the organization, repository, or environment level. For more information, see Defining configuration variables for multiple workflows.
Warning
By default, variables render unmasked in your build outputs. If you need greater security for sensitive information, such as passwords, use secrets instead. For more information, see About secrets.
For reference documentation, see Variables reference.