Switch language한국어
Back to the list

GitHub Actions: Scoping environment variables across environments without wildcards

TL;DR AI

Key summary

2 min read
  1. GitHub Actions does not support wildcard scoping for environment variables, unlike GitLab CI.

  2. It does support named environments with their own variables and secrets under Settings → Environments.

  3. A reusable deployment workflow can build the environment name from inputs.environment and inputs.name, with an apps segment.

  4. With 10 apps and 3 tiers, the setup creates 30 environments; tier-wide values like AWS_OIDC_IAM_ROLE_ARN, CDK_DEFAULT_ACCOUNT, and DOMAIN can stay shared.

  5. Setting 15 variables on each of 30 environments would create 450 entries, so the article stores tier-specific config in an ENVIRONMENT_CONFIG JSON repository variable.

Read the original