diff --git a/lib/linter.sh b/lib/linter.sh index a6fb1a02..cb271265 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -64,12 +64,20 @@ source /action/lib/functions/worker.sh # Source the function script(s) ########### # GLOBALS # ########### +# GitHub API root url +if [ -n "$GITHUB_CUSTOM_API_URL" ]; then + GITHUB_API_URL="${GITHUB_CUSTOM_API_URL}" +elif [ -z "$GITHUB_API_URL" ]; then + GITHUB_API_URL="https://api.github.com" +fi +# Remove trailing slash if present +GITHUB_API_URL="${GITHUB_API_URL%/}" + # Default Vars -DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location -LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter rules directory -GITHUB_API_URL="${GITHUB_CUSTOM_API_URL:-"https://api.github.com"}" # GitHub API root url -VERSION_FILE='/action/lib/functions/linterVersions.txt' # File to store linter versions -export VERSION_FILE # Workaround SC2034 +DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location +LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter rules directory +VERSION_FILE='/action/lib/functions/linterVersions.txt' # File to store linter versions +export VERSION_FILE # Workaround SC2034 ############### # Rules files #