Skip to content

Commit

Permalink
feat: do not react with emoji if "EmojiReaction" flag is empty (#4378)
Browse files Browse the repository at this point in the history
Co-authored-by: caio.rocha <[email protected]>
Co-authored-by: PePe Amengual <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
  • Loading branch information
4 people authored May 22, 2024
1 parent 82cd074 commit 388bbfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const (
DisableUnlockLabelFlag = "disable-unlock-label"
DiscardApprovalOnPlanFlag = "discard-approval-on-plan"
EmojiReaction = "emoji-reaction"
EnableDiffMarkdownFormat = "enable-diff-markdown-format"
EnablePolicyChecksFlag = "enable-policy-checks"
EnableRegExpCmdFlag = "enable-regexp-cmd"
EnableDiffMarkdownFormat = "enable-diff-markdown-format"
ExecutableName = "executable-name"
FailOnPreWorkflowHookError = "fail-on-pre-workflow-hook-error"
HideUnchangedPlanComments = "hide-unchanged-plan-comments"
Expand Down Expand Up @@ -158,7 +158,7 @@ const (
DefaultCheckoutDepth = 0
DefaultBitbucketBaseURL = bitbucketcloud.BaseURL
DefaultDataDir = "~/.atlantis"
DefaultEmojiReaction = "eyes"
DefaultEmojiReaction = ""
DefaultExecutableName = "atlantis"
DefaultMarkdownTemplateOverridesDir = "~/.markdown_templates"
DefaultGHHostname = "github.com"
Expand Down Expand Up @@ -276,7 +276,7 @@ var stringFlags = map[string]stringFlag{
defaultValue: "",
},
EmojiReaction: {
description: "Emoji Reaction to use to react to comments",
description: "Emoji Reaction to use to react to comments.",
defaultValue: DefaultEmojiReaction,
},
ExecutableName: {
Expand Down Expand Up @@ -460,6 +460,7 @@ var boolFlags = map[string]boolFlag{
description: "Disable atlantis auto planning feature",
defaultValue: false,
},

DisableRepoLockingFlag: {
description: "Disable atlantis locking repos",
},
Expand Down
5 changes: 2 additions & 3 deletions runatlantis.io/docs/server-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,8 @@ and set `--autoplan-modules` to `false`.
# or
ATLANTIS_EMOJI_REACTION=thumbsup
```

The emoji reaction to use for marking processed comments. Currently supported on Azure DevOps, GitHub and GitLab.
Defaults to `eyes`.
The emoji reaction to use for marking processed comments. Currently supported on Azure DevOps, GitHub and GitLab. If not specified, Atlantis will not use an emoji reaction.
Defaults to "" (empty string).

### `--enable-diff-markdown-format`

Expand Down
2 changes: 1 addition & 1 deletion server/controllers/events/events_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func (e *VCSEventsController) handleCommentEvent(logger logging.SimpleLogging, b
}
}

// It's a comment we're gonna react to, so add a reaction.
// It's a comment we're going to react to so add a reaction.
if e.EmojiReaction != "" {
err := e.VCSClient.ReactToComment(logger, baseRepo, pullNum, commentID, e.EmojiReaction)
if err != nil {
Expand Down

0 comments on commit 388bbfd

Please sign in to comment.