-
Notifications
You must be signed in to change notification settings - Fork 945
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the configuration of the GitHub server URL, and add some validation rules that check for common misconfigurations. Close #5572
- Loading branch information
1 parent
c99ec77
commit f8124fe
Showing
5 changed files
with
100 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
DEFAULT_GITHUB_DOMAIN="github.com" | ||
GITHUB_DOMAIN="${GITHUB_DOMAIN:-${DEFAULT_GITHUB_DOMAIN}}" | ||
GITHUB_DOMAIN="${GITHUB_DOMAIN%/}" # Remove trailing slash if present | ||
|
||
# GitHub API root url | ||
GITHUB_API_URL="${GITHUB_CUSTOM_API_URL:-"https://api.${GITHUB_DOMAIN}"}" | ||
GITHUB_API_URL="${GITHUB_API_URL%/}" # Remove trailing slash if present | ||
|
||
# shellcheck disable=SC2034 # Variable is referenced indirectly | ||
GITHUB_SERVER_URL="${GITHUB_CUSTOM_SERVER_URL:-"https://${GITHUB_DOMAIN}"}" | ||
GITHUB_SERVER_URL="${GITHUB_SERVER_URL%/}" # Remove trailing slash if present | ||
|
||
# shellcheck disable=SC2034 # Variable is referenced indirectly | ||
GITHUB_META_URL="${GITHUB_API_URL}/meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters