From a631229d6372db4ae2aba42203742b44ac4d7147 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 5 Apr 2024 14:21:24 -0500 Subject: [PATCH] chore: fix setallow funcs --- action/repo/add.go | 7 ++++++- action/repo/update.go | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/action/repo/add.go b/action/repo/add.go index 25f926c1..9b4dd21a 100644 --- a/action/repo/add.go +++ b/action/repo/add.go @@ -43,7 +43,12 @@ func (c *Config) Add(client *vela.Client) error { logrus.Tracef("adding repo %s/%s", c.Org, c.Name) if len(c.Events) > 0 { - r.SetAllowEvents(library.NewEventsFromSlice(c.Events)) + evs, err := library.NewEventsFromSlice(c.Events) + if err != nil { + return err + } + + r.SetAllowEvents(evs) } // send API call to add a repository diff --git a/action/repo/update.go b/action/repo/update.go index d8892659..07c7c70a 100644 --- a/action/repo/update.go +++ b/action/repo/update.go @@ -41,7 +41,12 @@ func (c *Config) Update(client *vela.Client) error { } if len(c.Events) > 0 { - r.SetAllowEvents(library.NewEventsFromSlice(c.Events)) + evs, err := library.NewEventsFromSlice(c.Events) + if err != nil { + return err + } + + r.SetAllowEvents(evs) } logrus.Tracef("updating repo %s/%s", c.Org, c.Name)