Repository navigation
Update git-sync.yml #3
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: git sync (Upstream → Fork) | ||
| on: | ||
| schedule: | ||
| # Daily at 22:30 IST ≈ 17:00 UTC (adjust to your preferred time) | ||
| - cron: '0 17 * * *' | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| name: sync with latest mainline branch | ||
| steps: | ||
| # step 1: run a standard checkout action, provided by github | ||
| - name: Checkout default branch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # non-shallow for clean merges | ||
| steps: | ||
| # step 2: run the sync action | ||
| - name: Git Sync | ||
| id: sync | ||
| uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 | ||
| with: | ||
| target_sync_branch: master | ||
| # required token same as below | ||
| target_repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
| upstream_sync_repo: torvalds/linux | ||
| upstream_sync_branch: master | ||
| # step 3: display a sample message for status | ||
| - name: New commits found | ||
| if: steps.sync.outputs.has_new_commits == 'true' | ||
| run: echo "New commits were found" | ||
| - name: No new commits | ||
| if: steps.sync.outputs.has_new_commits == 'false' | ||
| run: echo "No new commits." | ||