You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, fwiw the URL becomes ambiguous across platforms, sometimes it's the specific URL for that deployment (https://<deployid>.host.com) verse the configured domain (https://mydomain.com).
Yes indeed... I'm not sure if any of these platforms give access to the alias of main domain and if they do we might expose two vars for canonical domain. (BTW talking about our usecase of generatic permanent URLs for something like og-image, I would say this is even safer to rely on deploy-pinned URL)
CI/CD pipelines often provide variables such as deployment URL, git hash, git branch, etc. We might expose standard exports that can scan them.
Some providers:
Vercel
https://vercel.com/docs/projects/environment-variables/system-environment-variables
VERCEL_URL
,VERCEL_BRANCH_URL
,VERCEL_GIT_PROVIDER
,VERCEL_GIT_REPO_SLUG
,VERCEL_GIT_REPO_OWNER
,VERCEL_GIT_REPO_ID
,VERCEL_GIT_COMMIT_REF
,VERCEL_GIT_COMMIT_SHA
,VERCEL_GIT_COMMIT_MESSAGE
,VERCEL_GIT_COMMIT_AUTHOR_LOGIN
,VERCEL_GIT_COMMIT_AUTHOR_NAME
,VERCEL_GIT_PREVIOUS_SHA
Netlify
https://docs.netlify.com/configure-builds/environment-variables/
REPOSITORY_URL
,BRANCH
,HEAD
,COMMIT_REF
,CACHED_COMMIT_REF
,CACHED_COMMIT_REF
,PULL_REQUEST
,REVIEW_ID
,URL
,DEPLOY_URL
,DEPLOY_PRIME_URL
Github Actions
https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
GITHUB_SHA
,GITHUB_ACTOR
,GITHUB_API_URL
,GITHUB_BASE_REF
,GITHUB_HEAD_REF
,GITHUB_REF
,GITHUB_REF_NAME
,GITHUB_REPOSITORY
,GITHUB_REPOSITORY_OWNER
,GITHUB_REPOSITORY_OWNER_ID
,GITHUB_WORKFLOW_SHA
Gitlab CI
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
CI_COMMIT_AUTHOR
,CI_COMMIT_BEFORE_SHA
,CI_COMMIT_BRANCH
,CI_COMMIT_DESCRIPTION
,CI_COMMIT_MESSAGE
,CI_COMMIT_REF_NAME
,CI_COMMIT_SHA
,CI_COMMIT_SHORT_SHA
,CI_COMMIT_TAG
,CI_ENVIRONMENT_URL
,CI_PAGES_URL
,Cloudflare pages
https://developers.cloudflare.com/pages/configuration/build-configuration/#environment-variables
CF_PAGES
,CF_PAGES_COMMIT_SHA
,CF_PAGES_BRANCH
,CF_PAGES_URL
The text was updated successfully, but these errors were encountered: