diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 2e78c55..0cc1f19 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -18,7 +18,10 @@ UPSTREAM_GOMOD="https://gitea.com/gitea/runner/raw/tag" : "${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is required}" API="${GITHUB_API_URL:-${GITHUB_SERVER_URL}/api/v1}" -host=${GITHUB_SERVER_URL#http://}; host=${host#https://} +# Preserve the scheme of GITHUB_SERVER_URL — on a Gitea runner this is the +# internal endpoint (e.g. http://172.17.0.1:3000), which speaks plain HTTP. +scheme="${GITHUB_SERVER_URL%%://*}" +host="${GITHUB_SERVER_URL#*://}" api() { curl -fsSL -H "Authorization: token ${BUMP_TOKEN}" "$@"; } # --- determine versions ------------------------------------------------------ @@ -28,7 +31,7 @@ latest=$(curl -fsSL "$UPSTREAM_RSS" \ [ -n "$latest" ] || { echo "could not parse upstream version"; exit 1; } WORK=$(mktemp -d) -git clone "https://x-access-token:${BUMP_TOKEN}@${host}/${GITHUB_REPOSITORY}.git" "$WORK" +git clone "${scheme}://x-access-token:${BUMP_TOKEN}@${host}/${GITHUB_REPOSITORY}.git" "$WORK" cd "$WORK" pkgdir="dev-util/${PN}" @@ -111,7 +114,7 @@ body=$(cat <