tfnotify icon indicating copy to clipboard operation
tfnotify copied to clipboard

Conditional notification

Open syucream opened this issue 7 years ago • 1 comments

I'd like to notify terraform cmd result to slack only when it fails. I think we can implement it as a conditional notification function, like below:

---
ci: circleci
notifier:
  slack:
    token: $SLACK_TOKEN
    channel: $SLACK_CHANNEL_ID
    bot: $SLACK_BOT_NAME
terraform:
  plan:
    filters:
      only:
        - failed  # notify when terraform-plan failed
    template: |
      {{ .Message }}
      {{if .Result}}
      ```
      {{ .Result }}
      ```
      {{end}}
      ```
      {{ .Body }}
      ```

Do you have any opinion? And I try to implement a patch as PoC if you have no problem.

syucream avatar Jun 07 '18 05:06 syucream

@syucream Thank you for your suggestion.

It's good idea! (I thought that it should be implemented in the near future 😉) But YAML (struct) format should seem to be considered a bit more.

And I try to implement a patch as PoC if you have no problem.

👍

babarot avatar Jun 12 '18 08:06 babarot