SIGN IN SIGN UP

fix(ci): Add --force-with-lease to the Sync Staging workflow push (#4629)

<!-- mendral:session:action:01KXP0J5PASJRS79DPSGGRPPCC -->
## Summary

- Use `--force-with-lease` instead of plain `git push` in the Sync
Staging workflow to auto-recover when the `next` branch diverges from
`main`
- Prevents recurring non-fast-forward rejections that previously caused
a 34-day outage and have now recurred (2026-07-16)

## Context

The `next` branch exists solely to mirror `main`. When direct commits
land on `next`, the workflow fails with `! [rejected] main -> next
(non-fast-forward)` and stays broken until manually resynced.
`--force-with-lease` is safe here because the workflow checks out `main`
with full history — it will only force-push if the remote `next` ref
hasn't changed since the fetch, preventing accidental data loss while
still allowing the sync to self-heal.

Related insight:
https://app.mendral.com/insights/01KKCFF78F0WVQE1ND3HAG43M1



---

> [!NOTE]
> Created by [Mendral](https://mendral.com). Tag @mendral-app with
feedback or questions.
>
> - [View implementation
session](https://app.mendral.com/sessions/action:01KXP0J5PASJRS79DPSGGRPPCC)
> - Addresses [this
insight](https://app.mendral.com/insights/01KKCFF78F0WVQE1ND3HAG43M1)

Co-authored-by: mendral-app[bot] <233154221+mendral-app[bot]@users.noreply.github.com>
M
mendral-app[bot] committed
29cf43d858dd31b59d1a465561b622ce98f1fd2b
Parent: d56fe7e
Committed by GitHub <noreply@github.com> on 8/19/2026, 5:30:19 PM