atlantis
atlantis copied to clipboard
Automerge does not work is merge commits are not allowed
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
Automerge does not work if merge commits are not allowed.
Reproduction Steps
- Disable merge commits
- Enable automerge
- put up pr and plan/apply it
- see failure
Logs
atlantis-0 atlantis {"level":"error","ts":"2024-08-09T15:04:25.498Z","caller":"vcs/instrumented_client.go:241","msg":"Unable to merge pull, error: merging pull request: PUT https://api.github.com/repos/goldsky-io/goldsky-infra/pulls/1302/merge: 405 This branch must not contain merge commits. You're not authorized to push to this branch. Visit https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches for more informati []","json":{"repo":"goldsky-io/goldsky-infra","pull":"1302"},"stacktrace":"github.com/runatlantis/atlantis/server/events/vcs.(*InstrumentedClient).MergePull\n\tgithub.com/runatlantis/atlantis/server/events/vcs/instrumented_client.go:241\ngithub.com/runatlantis/atlantis/server/events/vcs.(*ClientProxy).MergePull\n\tgithub.com/runatlantis/atlantis/server/events/vcs/proxy.go:93\ngithub.com/runatlantis/atlantis/server/events.(*AutoMerger).automerge\n\tgithub.com/runatlantis/atlantis/server/events/automerger.go:35\ngithub.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\tgithub.com/runatlantis/atlantis/server/events/apply_command_runner.go:184\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:367"}
atlantis-0 atlantis {"level":"error","ts":"2024-08-09T15:04:25.498Z","caller":"events/automerger.go:38","msg":"automerging failed: merging pull request: PUT https://api.github.com/repos/goldsky-io/goldsky-infra/pulls/1302/merge: 405 This branch must not contain merge commits. You're not authorized to push to this branch. Visit https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches for more informati []","json":{"repo":"goldsky-io/goldsky-infra","pull":"1302"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*AutoMerger).automerge\n\tgithub.com/runatlantis/atlantis/server/events/automerger.go:38\ngithub.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\tgithub.com/runatlantis/atlantis/server/events/apply_command_runner.go:184\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:367"}
It would be great if we could have a config option to choose between merge and rebase when merging the PR