From 1e3054d0fc4510150242b72ac88e5e7126c8cc17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=BA=E6=A2=B0=E5=B0=8F=E9=B8=BD?= <128568434+jixiexiaoge@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:26:23 +0800 Subject: [PATCH] Create sync-branches.yml 2 --- .github/workflows/sync-branches.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/sync-branches.yml diff --git a/.github/workflows/sync-branches.yml b/.github/workflows/sync-branches.yml new file mode 100644 index 0000000..a170db1 --- /dev/null +++ b/.github/workflows/sync-branches.yml @@ -0,0 +1,46 @@ +name: Sync Branches + +on: + schedule: + # 每天10点UTC(你可以根据需要调整时区) + - cron: '0 10 * * *' + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout the main repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} + + - name: Setup Git + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@github.com" + + - name: Add remote for MoreTore/openpilot + run: | + git remote add moretore https://github.com/MoreTore/openpilot.git + git fetch moretore mazda-frogpilot-dev + + - name: Add remote for FrogAi/FrogPilot + run: | + git remote add frogai https://github.com/FrogAi/FrogPilot.git + git fetch frogai + + - name: Merge `mazda-frogpilot-dev` into current branch + run: | + git checkout main # 你可以修改为目标分支 + git merge moretore/mazda-frogpilot-dev --no-ff --commit -m "Sync with mazda-frogpilot-dev" + + - name: Merge `FrogPilot` into current branch + run: | + git merge frogai/FrogPilot --no-ff --commit -m "Sync with FrogPilot" + + - name: Push changes back to the main repository + run: | + git push origin main + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}