mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-03 19:18:47 +00:00
Fix: Do not automerge with errors or noop
Extra guards have been added to preven automatically merging a branch upstream when automerge is enabled but errors exist or if no commands where executed at all. An example of this bug in action is when you delete a plan and atlantis lock via the UI and then execute atlantis apply No projects are applied but the branch is automerged
This commit is contained in:
@@ -273,7 +273,8 @@ func (c *DefaultCommandRunner) RunCommentCommand(baseRepo models.Repo, maybeHead
|
||||
|
||||
c.updateCommitStatus(ctx, cmd.Name, pullStatus)
|
||||
|
||||
if cmd.Name == models.ApplyCommand && c.automergeEnabled(ctx, projectCmds) {
|
||||
// Do not automerge if no commands were executed at all, or if there have been errors
|
||||
if cmd.Name == models.ApplyCommand && c.automergeEnabled(ctx, projectCmds) && len(projectCmds) > 0 && !result.HasErrors() {
|
||||
c.automerge(ctx, pullStatus)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user