-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Automerge support for "require linear history" #1176
Comments
Hmm, we have code to detect which merge method to use: const (
defaultMergeMethod = "merge"
rebaseMergeMethod = "rebase"
squashMergeMethod = "squash"
)
method := defaultMergeMethod
if !repo.GetAllowMergeCommit() {
if repo.GetAllowRebaseMerge() {
method = rebaseMergeMethod
} else if repo.GetAllowSquashMerge() {
method = squashMergeMethod
}
}
// Now we're ready to make our API call to merge the pull request.
options := &github.PullRequestOptions{
MergeMethod: method,
} |
Can you make the GET repository API call and see what the value of the:
fields are? |
Might need a call to https://docs.github.com/en/rest/reference/repos#get-branch-protection somewhere in that logic |
Looks like that's the issue. For now you'll have to relax that rule or change your global repo settings. |
I've encountered this in a current client and I would propose rather than using the API to get the configuration of the repo to use a configuration variable in Atlantis to allow GitHub users to select their merge method. While this could be automated the revert showed that Atlantis does not currently have the permissions for this in most cases and providing more permissions to Atlantis to solve this might not be an option in all cases. |
Are there any plan to implement/solve this feature as suggested in the previous comment? |
When the automerge feature is enabled, but the target branch only supports linear history (i.e. not merge commits), atlantis fails to squash/merge the commit to the target branch after successful apply.
It looks like this issue was briefly raised in the original implementation of automerge, but seems to have gotten lost. #186 (comment)
Currently, we get this error on our repos:
Is this an oversight, or is this purposefully unsupported?
The text was updated successfully, but these errors were encountered: