Skip to content

Daily Sync with Upstream #402

Daily Sync with Upstream

Daily Sync with Upstream #402

Workflow file for this run

name: Daily Sync with Upstream
on:
schedule:
- cron: '0 0 * * *' # 北京时间0点开始每天运行一次
workflow_dispatch: # 允许手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Add upstream
run: git remote add upstream https://github.com/LmeSzinc/AzurLaneAutoScript.git
- name: Fetch upstream
run: git fetch upstream
- name: Force sync branches
run: |
for branch in master dev; do
echo "🔄 Syncing $branch..."
git checkout -B $branch upstream/$branch
git push -f origin $branch
done