Sync from Gitee #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync from Gitee | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # UTC时区; 每天凌晨执行一次 | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull changes from Gitee | |
run: | | |
git remote add gitee https://gitee.com/we-mid/go.git | |
git fetch gitee | |
# fix: Committer identity unknown | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
# 避免额外提交: Merge remote-tracking branch 'xx/xxx' | |
# git merge gitee/main --allow-unrelated-histories | |
# git push origin main | |
# 使用 rebase 而不是 merge | |
git rebase gitee/main | |
git push origin main --force-with-lease |