feat: add server_url input to override auto-detected API server URL
Allows specifying internal routing addresses for Gitea/GitHub API calls (e.g., http://server:3000), addressing container network restrictions when external URLs are not routable.
This commit is contained in:
+6
-1
@@ -86,7 +86,12 @@ REPO="${GITHUB_REPOSITORY:-${GITEA_REPOSITORY:-}}"
|
||||
|
||||
# Detect Gitea vs GitHub. Gitea sets $GITHUB_SERVER_URL too, so the only
|
||||
# reliable signal is $GITEA_ACTIONS (or a non-github.com server URL).
|
||||
SERVER_URL="${GITHUB_SERVER_URL:-${GITEA_SERVER_URL:-}}"
|
||||
#
|
||||
# $PI_SERVER_URL (server_url input) overrides the auto-detected server URL.
|
||||
# Gitea reports its *external* hostname (e.g. git.example.com), which may not
|
||||
# be routable from inside the runner's container network. Setting server_url
|
||||
# to the internal address (e.g. http://server:3000) fixes API calls.
|
||||
SERVER_URL="${PI_SERVER_URL:-${GITHUB_SERVER_URL:-${GITEA_SERVER_URL:-}}}"
|
||||
if [ -n "${GITEA_ACTIONS:-}" ] || { [ -n "$SERVER_URL" ] && [ "${SERVER_URL#*github.com}" = "$SERVER_URL" ]; }; then
|
||||
API_BASE="${SERVER_URL}/api/v1"
|
||||
PLATFORM="gitea"
|
||||
|
||||
Reference in New Issue
Block a user