diff --git a/act/model/workflow.go b/act/model/workflow.go index 54c33983..96e41be8 100644 --- a/act/model/workflow.go +++ b/act/model/workflow.go @@ -22,7 +22,7 @@ type Workflow struct { Jobs map[string]*Job `yaml:"jobs"` Defaults Defaults `yaml:"defaults"` - RawNotifications yaml.Node `yaml:"notifications"` + RawNotifications yaml.Node `yaml:"enable-email-notifications"` } // On events for the workflow @@ -772,10 +772,10 @@ func (w *Workflow) Notifications() (bool, error) { var val bool err := w.RawNotifications.Decode(&val) if err != nil { - return false, fmt.Errorf("notifications: failed to decode: %v", w.RawNotifications.Kind) + return false, fmt.Errorf("enable-email-notifications: failed to decode: %v", w.RawNotifications.Kind) } return val, nil default: - return false, fmt.Errorf("notifications: unknown type: %v", w.RawNotifications.Kind) + return false, fmt.Errorf("enable-email-notifications: unknown type: %v", w.RawNotifications.Kind) } } diff --git a/act/model/workflow_test.go b/act/model/workflow_test.go index 45cce2ea..9f2d2c31 100644 --- a/act/model/workflow_test.go +++ b/act/model/workflow_test.go @@ -123,20 +123,20 @@ func TestReadWorkflow_Notifications(t *testing.T) { { expected: true, hasErr: false, - snippet: "notifications: true", + snippet: "enable-email-notifications: true", }, { expected: false, hasErr: false, - snippet: "notifications: false", + snippet: "enable-email-notifications: false", }, { hasErr: true, - snippet: "notifications: invalid", + snippet: "enable-email-notifications: invalid", }, { hasErr: true, - snippet: "notifications: [1,2]", + snippet: "enable-email-notifications: [1,2]", }, } { t.Run(testCase.snippet, func(t *testing.T) {