Skip to content

Allow dynamic environment names (if/else approach)#1

Open
fabn wants to merge 1 commit into
mainfrom
feature/dynamic-env
Open

Allow dynamic environment names (if/else approach)#1
fabn wants to merge 1 commit into
mainfrom
feature/dynamic-env

Conversation

@fabn
Copy link
Copy Markdown
Owner

@fabn fabn commented Apr 16, 2026

Summary

  • Add regex pattern support to environment_targets input (e.g., "production,dev-.*,staging")
  • When a pattern like dev-.* matches user input dev-feature-1234, the resolved environment name is the actual user input, not the pattern
  • Invalid regex patterns fall back to exact string matching (no crash)
  • Implementation uses targetMatch() helper with all existing if/else comparison branches updated

Note: This is the "if/else" approach. See #2 for the alternative pattern-table approach.

Closes github#320

Test plan

  • All 427 existing tests pass
  • 14 new tests covering regex patterns, "to" syntax, noop, stable branch, params, lock/unlock, anchoring, invalid regex fallback
  • Manual test with environment_targets: "production,dev-.*" and .deploy to dev-anything

🤖 Generated with Claude Code

…ames

Environment targets like "dev-.*" now match user input such as
"dev-feature-1234". The resolved environment name is the user's actual
input, not the pattern. Invalid regex patterns fall back to exact match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow dynamic environment names

1 participant