Hello! When setting up the environment based on th...
# general
n
Hello! When setting up the environment based on the GitHub branch with
gitBranchToEnvironmentMapping
, after mapping
develop
,
staging
,
production
, I'm wondering if there is a way to do a catch-all for any other branch (
feature/
,
fix/
, etc...)
👀 2
If not, perhaps this could be a feature to consider:
Copy code
"gitBranchToEnvironmentMapping": {
    "develop": "dev",
    "staging": "staging",
    "production": "prod",
    "*": "dev",
  }
We rarely work directly on
develop
.
j
Hey Nick! There's no wildcard/catch-all support in
gitBranchToEnvironmentMapping
right now. It only does exact branch name matching. But the good news is
defaultEnvironment
already works as a catch-all. If the current branch doesn't match anything in the mapping, the CLI falls back to
defaultEnvironment
. So you can just do:
Copy code
1{
2  "workspaceId": "...",
3  "defaultEnvironment": "dev",
4  "gitBranchToEnvironmentMapping": {
5    "staging": "staging",
6    "production": "prod"
7  }
8}
Any branch not explicitly listed — feature/, fix/, develop, whatever, will automatically use
dev
. Should do exactly what you need! Let me know if this clears this up.
🙌 1
n
That's exactly what I needed! Thanks @Jake (Infisical)
❤️ 1