Repository navigation
Daily Sync with Upstream #402
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |