sync reports success (exit 0) when its internal push fails
(This issue was AI generated but I have read it, understood it, and I'm accountable for its content.)
Version: gh-stack v0.1.0.
Repro: a stack whose branches are already pushed; rebase the stack locally (tips now require a force-push); run gh stack sync.
Actual output:
Pushing 3 branches to origin...
⚠ Push failed — branches may need force push after rebase
Run `gh stack push` to push with --force-with-lease.
...
✓ Stack synced
with exit code 0, while the branches were not pushed.
Expected: either sync pushes with --force-with-lease --atomic as its own documentation describes (step 5 of the sync help text), or the run exits non-zero when the push step fails. A warning followed by a success line and a zero exit makes sync unusable in scripts and easy to misread interactively.
I also ran into this issue and can confirm it's still present on v0.2.0. The following text in the included agent skill makes it particularly dangerous:
https://github.com/github/gh-stack/blob/d4ab7ab47e5b3e3708a27c8c42abcdf4bc321419/skills/gh-stack/SKILL.md?plain=1#L131-L132