From 8a61685f3c3459d4678aea6baaa0923f7707c00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=BA=E6=A2=B0=E5=B0=8F=E9=B8=BD?= <128568434+jixiexiaoge@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:47:33 +0800 Subject: [PATCH] Update sync-to-gitea.yml q --- .github/workflows/sync-to-gitea.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-to-gitea.yml b/.github/workflows/sync-to-gitea.yml index bbe7f09..27e79f9 100644 --- a/.github/workflows/sync-to-gitea.yml +++ b/.github/workflows/sync-to-gitea.yml @@ -29,7 +29,9 @@ jobs: # 遍历每一个分支并推送到Gitea for branch in $(git branch -r | grep -v '\->'); do + # 获取每个分支的名称 + branch_name=$(echo $branch | sed 's/origin\///') # 去掉 origin/ git checkout --track $branch - # 修复URL中的错误,移除多余的 http:// - git push http://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/${GITEA_REPO}.git HEAD:$branch + # 推送每个分支到 Gitea + git push http://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/${GITEA_REPO}.git $branch_name:$branch_name done