OSS-Docs-Tools / code-owner-self-merge

A GitHub Action for letting CODEOWNERS merge PRs via green PR reviews
MIT License
52 stars 16 forks source link

Add ability to stash and rebase in addition to merge #17

Closed diogotcorreia closed 3 years ago

diogotcorreia commented 3 years ago

This PR allows for merging using squash and rebase.

Why?

Some repos (mine including) have disabled the default merge strategy and instead squash all pull requests. This action silently fails with

Looking at PR: [my PR name]
(node:1497) UnhandledPromiseRejectionWarning: HttpError: Merge commits are not allowed on this repository.

EDIT: On version 1.5.1, it commented on the PR

There was an issue merging, maybe try again diogotcorreia.

Other information

I don't really know how to test GitHub Actions, so I haven't tested it. Just tested it, it works perfectly.

Also, TypeScript was complaining about the conversion from string to 'merge' | 'squash' | 'rebase'. I also don't really know how to fix that, so I added // @ts-ignore.

Feel free to request changes if needed.

orta commented 3 years ago

Yep, looks good to me 👍🏻