I have branch subdomains configured for my site, porter.sh. When I have a branch named v1, there is a corresponding subdomain v1.porter.sh. As part of my build, I need the final production URL for my site. For branch builds with subdomains, that would be something like “release-v1.porter.sh”, but I can’t find any environment variables that have that value.
I have tried $DEPLOY_PRIME_URL, but for branches it has the value “release-v1–porter.netlify.app” and doesn’t give me the branch subdomain. I have also tried $URL but that only gives me the root site domain, “porter.sh”.
Is there an environment variable with the branch subdomain or should I be writing bash to extract the branch name from the DEPLOY_PRIME_URL?