Create sync-upstream.yml

This commit is contained in:
zhizhi200271 2026-04-13 17:04:00 +08:00 committed by GitHub
parent d89fd5a371
commit fba39cc6b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 34 additions and 0 deletions

34
.github/workflows/sync-upstream.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: 🔄 同步冰朔上游仓库
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: $ secrets.GITHUB_TOKEN
- name: 配置 Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: 添加上游仓库(冰朔)
run: |
git remote add upstream https://github.com/qinfendebingshuo/guanghulab.git || true
git fetch upstream
- name: 合并上游更新到主分支
run: |
git checkout main
git merge upstream/main --no-edit --allow-unrelated-histories
- name: 推送到你的仓库
run: git push origin main