What Is GITHUB_SERVER_URL?
GITHUB_SERVER_URL is the base web URL of the GitHub instance, e.g. https://github.com.
GITHUB_SERVER_URL lets you build links that work on both github.com and GitHub Enterprise Server, instead of hard-coding the domain.
Example
Build a portable link to the commit.
shell
echo "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"Key takeaways
- GITHUB_SERVER_URL is the GitHub base URL.
- Differs on GitHub Enterprise.
- Use it instead of hard-coding github.com.
Related guides
What Is GITHUB_API_URL?GITHUB_API_URL is the REST API base URL in a GitHub Actions run. Learn how to use it for portable API calls.
What Is GITHUB_REPOSITORY?GITHUB_REPOSITORY is the owner/name slug of the repo running a GitHub Actions workflow, like octocat/hello-wo…
What Is GITHUB_SHA?GITHUB_SHA is the commit SHA that triggered a GitHub Actions workflow run. Learn what it contains and how to…