Nathanmalnoury / gh-backport-action

Github action to backport PR.
MIT License
2 stars 4 forks source link

Implement a way to squash commits #5

Open Nathanmalnoury opened 2 years ago

Nathanmalnoury commented 2 years ago

Should be optionnal, or be triggered by the merge strategy chosen to merge the target_branch initially.

As per the squash question, I guess the answer would be "quite easy": In backport_commits (main.py:20) where holding every commit hash there is in that branch in commits. According to this SO https://stackoverflow.com/a/5201642, we could use the first hash in commits to do something like:

git('reset', '--soft', first_hash')
git('commit')

And then git(push) as it's currently done in line 35.