From 15b83e7318abc93e6fa22c482b6ce8c79cc7c66e Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sat, 12 Sep 2026 15:28:08 +0200 Subject: [PATCH] ci: preserve http protocol for internal gitea runner clone --- .gitea/workflows/releases.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/releases.yml b/.gitea/workflows/releases.yml index 32369e3..647909d 100644 --- a/.gitea/workflows/releases.yml +++ b/.gitea/workflows/releases.yml @@ -20,11 +20,12 @@ jobs: env: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git config --global init.defaultBranch main git config --global --add safe.directory "$GITHUB_WORKSPACE" - SERVER_HOST=$(echo "${{ github.server_url }}" | sed -e 's|^https://||' -e 's|^http://||') + CLONE_URL=$(echo "${{ github.server_url }}" | sed -E "s|^(https?://)|\1${GITEA_TOKEN}@|")/${{ github.repository }}.git git init - git remote add origin "https://${GITEA_TOKEN}@${SERVER_HOST}/${{ github.repository }}.git" || \ - git remote set-url origin "https://${GITEA_TOKEN}@${SERVER_HOST}/${{ github.repository }}.git" + git remote add origin "$CLONE_URL" || git remote set-url origin "$CLONE_URL" + git config http.extraheader "AUTHORIZATION: token ${GITEA_TOKEN}" git fetch --depth 1 origin "${{ github.sha }}" || git fetch --depth 1 origin main git checkout -f FETCH_HEAD