Skip to content

Commit

Permalink
github actions: sync-from-gitee
Browse files Browse the repository at this point in the history
  • Loading branch information
fritx committed Aug 2, 2024
1 parent 8708621 commit 3354dfd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/sync-from-gitee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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

0 comments on commit 3354dfd

Please sign in to comment.