rebase
rebase copied to clipboard
Autosquash
Fixes #20
@fkorotkov was this closed on purpose? Didn't you mean to merge it instead?
It didn't work for me actually. You can try to use this branch via uses: cirrus-actions/rebase@autosquash
(changed master
to autosquash
). Closed it until find a better way.
rebase
Looks like the issue with this attempt was that it was missing the --interactive
rebase flag. The --autosquash
flag does not work outside of a interactive rebase. Luckily there is a hack around this: https://stackoverflow.com/questions/29094595/git-interactive-rebase-without-opening-the-editor In summary, the solution is to run the following to get a non-interactive autosquash rebase:
GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash origin/$BASE_BRANCH
I'll work on a PR for this, borrowing from this PR's branch.
@samholmes thank you for the finding! I've rebased the branch. PTAL.
@fkorotkov Why not review my PRs changes? I'd appreciate the contributor recognition 😉
Looking at this PR some of my grips are with the fixup commits. There's no need to make a mistake, then fix the mistake in a separate commit unless the commit has already been merged to the base branch. The commits to this PR could use some rebasing to make a clean commit history.
Secondly, if you look closely at how I've implemented the feature, I intentionally chose to use action inputs to enable or disable autosquash; this allows for the user of this action to decide on what event will trigger the action with the autosquash input (paramater). For example, one could choose to trigger this action on the pull_request_review
event to automatically rebase and auto-squash when the PR is approved.