Support non-force branch update strategy #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/2-non-force-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The action always force-pushed an existing head branch when updating a PR. That conflicts with branch protection on automation branches that forbids force-push, and with branches that must keep linear history.
This adds a
push-strategyinput:force(default): force-push, unchanged from today.merge/rebase: fold the existing remote branch into the new commit and push without force, so a protected or linear-history branch is preserved.fail-if-diverged(aliasno-force): push without force and stop on a non-fast-forward.A merge/rebase conflict or a rejected non-force push fails the step cleanly and leaves the remote branch untouched rather than overwriting it. Documented in the README (new Update strategy section), MIGRATION.md, and the changelog.
Tested with
make all: the offline suite gains cases for the explicit force path (unchanged), merge and rebase against an existing remote branch (fetch + fold, no-f), a non-force push to a fresh branch, the non-fast-forward rejection, a rebase conflict, and an invalid strategy value.Closes #2.