Repository navigation
Sync Development #36
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: Sync Development | |
| 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 | |
| steps: | |
| # step 1: checkout (default branch) | |
| - name: Checkout development branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: development | |
| fetch-depth: 0 # non-shallow for clean merges | |
| - name: Configure Git identity | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| - name: Add upstream remote | |
| run: | | |
| git remote add upstream https://github.com/torvalds/linux.git || true | |
| git fetch upstream | |
| # step 2: Update master (mirror) | |
| - name: Sync master | |
| run: | | |
| git checkout master || git checkout -b master | |
| git reset --hard upstream/master | |
| git push origin master --force | |
| echo "✅ master is now aligned with upstream" | |
| # step 3: Rebase development on updated master | |
| - name: Rebase development | |
| run: | | |
| git checkout development | |
| git rebase master | |
| git push origin development --force | |
| echo "✅ development successfully rebased" |