Skip to content

Commit

Permalink
Merge pull request #549 from hashicorp/support_cv_notifications
Browse files Browse the repository at this point in the history
Add support for CV failure notification type
  • Loading branch information
sebasslash committed Oct 24, 2022
2 parents 3c77f60 + 880aee6 commit cdcd0b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,10 @@
# (Unreleased)
# Unreleased

## Enhancements

* Add `NotificationTriggerAssessmentCheckFailed` notification trigger type by @rexredinger [#549](https://github.com/hashicorp/go-tfe/pull/549)

# v1.11.0

## Enhancements

Expand Down
20 changes: 11 additions & 9 deletions notification_configuration.go
Expand Up @@ -45,14 +45,15 @@ type notificationConfigurations struct {
type NotificationTriggerType string

const (
NotificationTriggerCreated NotificationTriggerType = "run:created"
NotificationTriggerPlanning NotificationTriggerType = "run:planning"
NotificationTriggerNeedsAttention NotificationTriggerType = "run:needs_attention"
NotificationTriggerApplying NotificationTriggerType = "run:applying"
NotificationTriggerCompleted NotificationTriggerType = "run:completed"
NotificationTriggerErrored NotificationTriggerType = "run:errored"
NotificationTriggerAssessmentDrifted NotificationTriggerType = "assessment:drifted"
NotificationTriggerAssessmentFailed NotificationTriggerType = "assessment:failed"
NotificationTriggerCreated NotificationTriggerType = "run:created"
NotificationTriggerPlanning NotificationTriggerType = "run:planning"
NotificationTriggerNeedsAttention NotificationTriggerType = "run:needs_attention"
NotificationTriggerApplying NotificationTriggerType = "run:applying"
NotificationTriggerCompleted NotificationTriggerType = "run:completed"
NotificationTriggerErrored NotificationTriggerType = "run:errored"
NotificationTriggerAssessmentDrifted NotificationTriggerType = "assessment:drifted"
NotificationTriggerAssessmentFailed NotificationTriggerType = "assessment:failed"
NotificationTriggerAssessmentCheckFailed NotificationTriggerType = "assessment:check_failure"
)

// NotificationDestinationType represents the destination type of the
Expand Down Expand Up @@ -355,7 +356,8 @@ func validNotificationTriggerType(triggers []NotificationTriggerType) bool {
NotificationTriggerErrored,
NotificationTriggerPlanning,
NotificationTriggerAssessmentDrifted,
NotificationTriggerAssessmentFailed:
NotificationTriggerAssessmentFailed,
NotificationTriggerAssessmentCheckFailed:
continue
default:
return false
Expand Down

0 comments on commit cdcd0b6

Please sign in to comment.