menu
Channels
# All channels
view-forward
# General
view-forward
# Announcements
view-forward
# Docs
view-forward
# JavaScript
view-forward
# Peril
view-forward
# Ruby
view-forward
# Swift
view-forward
Team

Is there a way to tell Danger to post a new comment, instead of update the old…

September 30, 2018 at 2:51pm

Is there a way to tell Danger to post a new comment, instead of update the old one?

September 30, 2018 at 2:51pm
Or is that intentional to avoid spam that it's not possible?
For a minute there I thought that was what the `sticky` did, but then read the docs to realize it wasn't it.

September 30, 2018 at 2:55pm
Yep, there's a --new-comment option to bundle exec danger and it will always post new posts 👍🏾
  • reply
  • like
Ah right, that seems to be what we're looking for.
  • reply
  • like
Thx!
  • reply
  • like
I've just added this to the FAQ
like-fill
1
  • reply
  • like
Ohhh so that's an option of the command line, not on the `warn`, `markdown`, etc functions. That's a place I didn't look for it!
Wouldn't it make more sense to have it as a flag in the Dangerfile, like Danger.new_comment = true or something? (Or even on each `warn`, `message`, … functions, similar to `sticky`… which would allow some messages to just be updates and others to be new comments, depending on the aim of each message… but probably more cumbersome to implement in Danger then I guess)
  • reply
  • like
Subsequent question then: is it possible to detect from inside the Dangerfile if we'll will trigger a new comment or update an existing one?
So that we can `warn("Hello, I'm Eve your friendly bot. Thanks for contributing")` only on the first comment of the PR, but `warn("Please add a CHANGELOG entry to credit yourself")` as a new comment every time it's missing in new commits?
  • reply
  • like

September 30, 2018 at 9:53pm
I don't really see the need for the feature, personally, so I'm hesitant to add something like this. I want to reduce comments from danger generally, so having it email me a lot feels spamy - but you can mix the --danger-id and --new-comment option to replicate what you want by running two Dangerfiles.
like-fill
1
  • reply
  • like