55 lines
2.0 KiB
YAML
55 lines
2.0 KiB
YAML
name: Sync Branch
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 10 * * *' # 每天 UTC 10 点运行
|
|
workflow_dispatch: # 允许手动触发
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# 1. Checkout the target repository (your repo)
|
|
- name: Checkout the target repository (your repo)
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0 # 完整克隆仓库,确保所有历史记录
|
|
token: ${{ secrets.GH_TOKEN }} # 访问 GitHub 需要的令牌
|
|
|
|
# 2. Add the source repositories as remotes and fetch branches
|
|
- name: Add upstream repositories and fetch branches
|
|
run: |
|
|
git remote add upstream https://github.com/ajouatom/openpilot.git
|
|
git fetch upstream v8-wip4 v8-wip4-da --no-tags
|
|
|
|
git remote add mazda_upstream https://github.com/heqichen/qcpilot.git
|
|
git fetch mazda_upstream dev-cpp-selfdrived --no-tags
|
|
|
|
git remote add kisapilot_upstream https://github.com/kisapilot/openpilot.git
|
|
git fetch kisapilot_upstream KisaPilot --no-tags
|
|
|
|
# 3. Push v8-wip4 branch to your repository
|
|
- name: Push v8-wip4 branch to your repository
|
|
run: |
|
|
git checkout -B v8-wip4 upstream/v8-wip4
|
|
git push origin v8-wip4 --force
|
|
|
|
# 4. Push v8-wip4-da branch to your repository
|
|
- name: Push v8-wip4-da branch to your repository
|
|
run: |
|
|
git checkout -B v8-wip4-da upstream/v8-wip4-da
|
|
git push origin v8-wip4-da --force
|
|
|
|
# 5. Push dev-cpp-selfdrived branch to your repository
|
|
- name: Push dev-cpp-selfdrived branch to your repository
|
|
run: |
|
|
git checkout -B dev-cpp-selfdrived mazda_upstream/dev-cpp-selfdrived
|
|
git push origin dev-cpp-selfdrived --force
|
|
|
|
# 6. Push KisaPilot branch to your repository
|
|
- name: Push KisaPilot branch to your repository
|
|
run: |
|
|
git checkout -B KisaPilot kisapilot_upstream/KisaPilot
|
|
git push origin KisaPilot --force
|