Secrets & Variables
Secrets
Section titled “Secrets”Secrets store sensitive values like API tokens, deploy keys, and webhook URLs. Values are referenced via environment variables to keep them out of YAML files.
spec: secrets: - name: DEPLOY_TOKEN value: "${ENV_DEPLOY_TOKEN}" - name: SLACK_WEBHOOK value: "${ENV_SLACK_WEBHOOK}"${ENV_DEPLOY_TOKEN} is resolved from the environment where gh infra apply runs — your terminal or CI environment.
Limitations
Section titled “Limitations”GitHub does not expose secret values via the API. This means:
plancan detect new secrets (ones that don’t exist yet on GitHub), but it cannot compare existing values. Even if the value has changed,planwill show no diff.- To force-update secrets, use the
--force-secretsflag. This re-sets all secrets regardless of whether they’ve changed.
gh infra apply ./repos/ --force-secretsThis is useful after rotating credentials — without the flag, apply would skip existing secrets because it can’t tell they’ve changed.
Variables
Section titled “Variables”Variables store non-sensitive configuration like environment names or regions.
spec: variables: - name: APP_ENV value: production - name: REGION value: us-central1Unlike secrets, variable values are visible via the API. plan can show the full diff when a value changes.