Repository navigation
Sync Development #6
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: # ✅ Manual trigger button | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| name: sync with latest mainline branch | |
| steps: | |
| # step 1: checkout your fork (default branch) | |
| - name: Checkout default branch | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # non-shallow for clean merges | |
| # step 2: sync fork with upstream (Linus' tree) | |
| - 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: log result | |
| - name: New commits found | |
| if: steps.sync.outputs.has_new_commits == 'true' | |
| run: echo "✅ New commits were found and synced from upstream" | |
| - name: No new commits | |
| if: steps.sync.outputs.has_new_commits == 'false' | |
| run: echo "ℹ️ Fork is already up to date." |