Rebase dev onto Upstream #229
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: Rebase dev onto Upstream | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| schedule: | |
| - cron: '0 2,14 * * *' # 每天 2:00 和 14:00 UTC 自动执行 | |
| workflow_dispatch: # 支持手动触发 | |
| jobs: | |
| rebase: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout dev branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: dev | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 # 必须完整历史才能 rebase | |
| - name: Set up 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/runhey/OnmyojiAutoScript.git | |
| git fetch upstream dev | |
| - name: Rebase onto Upstream/dev | |
| run: | | |
| git rebase upstream/dev || (git rebase --abort && exit 1) | |
| - name: Push to Fork | |
| run: | | |
| git push origin dev --force-with-lease |