diff --git a/server/events/vcs/github_client.go b/server/events/vcs/github_client.go index 3d0ee6bd0..9629e4e0b 100644 --- a/server/events/vcs/github_client.go +++ b/server/events/vcs/github_client.go @@ -159,7 +159,8 @@ func (g *GithubClient) HideOldComments(repo models.Repo, pullNum int) error { // a reasonable one, given we've already filtered the comments by the // configured Atlantis user. body := strings.Split(comment.GetBody(), "\n") - if !strings.Contains(body[0], models.ApplyCommand.String()) { + firstLine := strings.ToLower(body[0]) + if !strings.Contains(firstLine, models.PlanCommand.String()) { continue } var m struct { diff --git a/server/events/vcs/github_client_test.go b/server/events/vcs/github_client_test.go index f8d4027ce..1ae64d409 100644 --- a/server/events/vcs/github_client_test.go +++ b/server/events/vcs/github_client_test.go @@ -137,14 +137,14 @@ func TestGithubClient_GetModifiedFilesMovedFile(t *testing.T) { func TestGithubClient_HideOldComments(t *testing.T) { // Only comment 6 should be minimized, because it's by the same Atlantis bot user - // and it has "apply" in the first line of the comment body. + // and it has "plan" in the first line of the comment body. issueResp := `[ - {"node_id": "1", "body": "asd\napply\nasd", "user": {"login": "someone-else"}}, - {"node_id": "2", "body": "asd apply\nasd", "user": {"login": "someone-else"}}, + {"node_id": "1", "body": "asd\nplan\nasd", "user": {"login": "someone-else"}}, + {"node_id": "2", "body": "asd plan\nasd", "user": {"login": "someone-else"}}, {"node_id": "3", "body": "asdasdasd\nasdasdasd", "user": {"login": "someone-else"}}, {"node_id": "4", "body": "asdasdasd\nasdasdasd", "user": {"login": "user"}}, - {"node_id": "5", "body": "asd\napply\nasd", "user": {"login": "user"}}, - {"node_id": "6", "body": "asd apply\nasd", "user": {"login": "user"}}, + {"node_id": "5", "body": "asd\nplan\nasd", "user": {"login": "user"}}, + {"node_id": "6", "body": "asd plan\nasd", "user": {"login": "user"}}, {"node_id": "7", "body": "asdasdasd", "user": {"login": "user"}} ]` minimizeResp := "{}"