Skip to content

Managing CI/CD Variables and Secrets

CI/CD variables let you pass configuration and secrets to pipeline jobs without hardcoding values in the repository.

  1. Navigate to Settings > CI/CD > Variables.
  2. Click Add variable and provide a Key and Value.
  3. Set options for Protected, Masked, or Environment scope as needed.
  4. Save the variable.
job:
script:
- echo "Running as $MY_VAR"

Variables are available as environment variables within jobs.

  • Mask secrets to prevent exposure in logs.
  • Protect variables used only in protected branches or production environments.
  • Rotate sensitive values periodically and remove unused variables.