fix(bump): preserve GITHUB_SERVER_URL scheme when cloning
CI / build (push) Failing after 5m27s

The Gitea runner's GITHUB_SERVER_URL is the internal http endpoint
(http://172.17.0.1:3000); hard-coding https:// in the clone URL caused a TLS
error. Derive the scheme from GITHUB_SERVER_URL, and use the public host for
the PR-body vendor link.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ali
2026-05-20 20:59:08 -05:00
parent 9fe57aee71
commit ee9cca3d81
+6 -3
View File
@@ -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 <<EOF
Automated bump of \`dev-util/${PN}\` from ${current} to ${latest}.
- Upstream release: https://gitea.com/gitea/runner/releases/tag/v${latest}
- Vendor tarball: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${vendor_tag}
- Vendor tarball: https://git.azy.dev/${GITHUB_REPOSITORY}/releases/tag/${vendor_tag}
Review checklist:
- [ ] LICENSE still covers all vendored module licenses (\`go-licenses report ./...\`)