When you put your HEROKU_APP_NAME in your CI variables (under Settings → CI/CD → Variables) you can limit the scope of the variable by environment, and so use different values for the same variable on different branches.
Mapping your example with a concrete example of rules, and defining 2 rules to match the default branch (main) and dev in the branch name. When the rules are matched, they override the default variable.
For testing purposes, I have added the names on top in the variables section. Suggest moving this into the project settings next to the API KEY.
The variables section on top is only for easy-testing. Recommend to remove them, and keep using CI/CD variables from the project settings to keep the credentials safe.
hi @dnsmichi
i would prefer the example to use different names for the stage where the heroku_deploy is run.
using stage: production in an example where the app name is overridden by something called _DEV might mislead people.
imho you should always be VERY distinct on naming stuff and obviously a dev branch or MR artifact should not be deployed to production (yes yes there might be edge cases:D)
i would suggest calling the “production” stage “deploy”. this would describe what it actually does and would leave room for other deploy jobs like mr_deploy
@cy4n Thanks for moving the discussion here, and sharing your feedback. I’ve missed to verify the full context when creating an example - updated the config snippet and replaced the screenshot above