Skip to content
Latchkey

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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →