
GitHub Actions: Scoping environment variables across environments without wildcards
If you're running a monorepo where multiple apps deploy independently through multiple environments, you'll eventually hit a limitation that GitLab CI handles natively: GitHub Actions doesn't support wildcards for environment variable scoping. In this post, I'll explain why this becomes a real problem and how to work around it using a single repository variable and a jq one-liner. The Problem GitHub Actions supports named environments with their own variables and secrets, configured under Settings → Environments . For a single app with testing , staging , and production environments, this works fine - you define your variables three times and you're done. The problem arises in a monorepo where multiple apps deploy independently, each with its own GitHub environment per tier. Independent per-app environments are useful because they give you fine-grained protection rules: you can require a reviewer for production/apps/dashboard without blocking production/apps/performance . In a reusable
Continue reading on Dev.to
Opens in a new tab


