Update sync-to-gitea.yml

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

View File

@ -18,7 +18,7 @@ jobs:
git config --global user.name "Your Name" git config --global user.name "Your Name"
git config --global user.email "your-email@example.com" git config --global user.email "your-email@example.com"
- name: Push all branches to Gitea - name: Push all branches to Gitea (force push)
env: env:
GITEA_URL: '124.220.61.41:5000' # 你的Gitea地址不带 http:// GITEA_URL: '124.220.61.41:5000' # 你的Gitea地址不带 http://
GITEA_REPO: 'zhudongjer/openpilot' # Gitea上的仓库名 GITEA_REPO: 'zhudongjer/openpilot' # Gitea上的仓库名
@ -32,6 +32,7 @@ jobs:
# 获取每个分支的名称 # 获取每个分支的名称
branch_name=$(echo $branch | sed 's/origin\///') # 去掉 origin/ branch_name=$(echo $branch | sed 's/origin\///') # 去掉 origin/
git checkout --track $branch git checkout --track $branch
# 推送每个分支到 Gitea
git push http://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/${GITEA_REPO}.git $branch_name:$branch_name # 强制推送每个分支到 Gitea覆盖远程分支
git push --force http://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/${GITEA_REPO}.git $branch_name:$branch_name
done done