Auto Sync Fork #112
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: Auto Sync Fork | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # 每天 00:00 UTC 自动运行 | |
| workflow_dispatch: # 支持手动触发 | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout target repo | |
| uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false | |
| - name: Set git config | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Add upstream and fetch | |
| run: | | |
| git remote add upstream https://github.com/alantang1977/X.git | |
| git fetch upstream | |
| git checkout main | |
| git merge upstream/main || true | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |