name: Sync Fork on: schedule: - cron: '0 0 * * *' # 每天 UTC 时间 0 点运行一次 workflow_dispatch: # 允许手动触发 jobs: sync: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Sync upstream changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} run: | gh repo sync $OWNER/$REPO -b main