Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support merge_method options #13

Closed
robandpdx opened this issue Sep 6, 2022 · 0 comments · Fixed by #89
Closed

support merge_method options #13

robandpdx opened this issue Sep 6, 2022 · 0 comments · Fixed by #89

Comments

@robandpdx
Copy link
Collaborator

robandpdx commented Sep 6, 2022

Merges will fail if the repo is configured to disallow merge commits for PRs. Add an option to configure the merge_method to be used for merging.

https://docs.github.com/en/rest/pulls/pulls#merge-a-pull-request

Values can be merge,squash, or rebase. Default to merge.

We can check the pull request.labeled event to see what merge method is allowed. If merge commits are allowed, use merge, else try squash and finally use rebase as a last resort.

if (event.pull_request.base.repo.allow_merge_commit == 'true') {
  mergeMethod = 'merge'
} else if (event.pull_request.base.repo.allow_squash_merge == 'true) {
  mergeMethod = 'squash'
} else {
  mergeMethod = 'rebase'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant