fix: use username+token auth for release publish

This commit is contained in:
袁震
2026-04-06 14:26:09 +08:00
parent 568d97a44a
commit 8f38c77416
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -96,6 +96,7 @@ jobs:
shell: bash
env:
GITEA_BASE_URL: ${{ vars.GITEA_BASE_URL }}
GITEA_USERNAME: ${{ vars.GITEA_USERNAME }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
TARGET_OWNER: ${{ vars.TARGET_OWNER }}
TARGET_REPO: ${{ vars.TARGET_REPO }}
@@ -108,14 +109,15 @@ jobs:
fi
base="${GITEA_BASE_URL:-https://git.halonice.com}"
base="${base%/}"
username="${GITEA_USERNAME:-yuanzhen869}"
owner="${TARGET_OWNER:-yuanzhen869}"
repo="${TARGET_REPO:-shunt-rules-release}"
branch="${TARGET_BRANCH:-main}"
if [[ "${base}" == https://* ]]; then
release_url="https://${GITEA_TOKEN}@${base#https://}/${owner}/${repo}.git"
release_url="https://${username}:${GITEA_TOKEN}@${base#https://}/${owner}/${repo}.git"
elif [[ "${base}" == http://* ]]; then
release_url="http://${GITEA_TOKEN}@${base#http://}/${owner}/${repo}.git"
release_url="http://${username}:${GITEA_TOKEN}@${base#http://}/${owner}/${repo}.git"
else
echo "GITEA_BASE_URL must start with http:// or https://" >&2
exit 1