Skip to content

Commit

Permalink
chore: fix setallow funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Apr 5, 2024
1 parent edccc74 commit a631229
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion action/repo/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion action/repo/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a631229

Please sign in to comment.