Derive branch name from environment first.