Update sync-to-gitea.yml

q
This commit is contained in:
机械小鸽 2024-12-07 17:47:33 +08:00 committed by GitHub
parent a8ba0f3d37
commit 8a61685f3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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