What Is GITHUB_API_URL?
GITHUB_API_URL is the base URL for the GitHub REST API, e.g. https://api.github.com.
When a workflow calls the GitHub API directly with curl, GITHUB_API_URL keeps it portable across github.com and Enterprise.
Example
Call the API with the right base.
shell
curl -H "Authorization: Bearer ${GITHUB_TOKEN}" "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}"Key takeaways
- GITHUB_API_URL is the REST API base.
- Portable across Enterprise.
- Pair with GITHUB_TOKEN for auth.