Skip to content

Release: Netlify_2026-12-02.03 (#67) #13

Release: Netlify_2026-12-02.03 (#67)

Release: Netlify_2026-12-02.03 (#67) #13

name: Sync Main → Dev
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.SYNC_BOT_APP_ID }}
private-key: ${{ secrets.SYNC_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Configure Git
run: |
git config user.name "chrisert-sync-bot[bot]"
git config user.email "chrisert-sync-bot[bot]@users.noreply.github.com"
- name: Sync main to dev
run: |
git fetch origin dev
git checkout dev
# Check if dev and main have diverged with conflicts
if git rebase origin/main; then
echo "Rebase successful"
else
echo "Rebase failed due to conflicts - resetting dev to main"
git rebase --abort
git reset --hard origin/main
fi
# Create empty commit to mark sync completion
git commit --allow-empty -m "chore: sync from main"
# Push with force-with-lease (safe force push that fails if remote has new commits)
# This workflow uses a GitHub App token to push to the protected branch
git push origin dev --force-with-lease