mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-16 14:22:41 +00:00
Some small code refactorings (#1727)
Refactorings taken from pull requests #1722 and #1725
This commit is contained in:
@@ -125,8 +125,8 @@ var validDockerImageString = regexp.MustCompile(
|
||||
// Validate validates the required fields and formats.
|
||||
func (s *Secret) Validate() error {
|
||||
for _, event := range s.Events {
|
||||
if !ValidateWebhookEvent(event) {
|
||||
return fmt.Errorf("%w: '%s'", ErrSecretEventInvalid, event)
|
||||
if err := ValidateWebhookEvent(event); err != nil {
|
||||
return errors.Join(err, ErrSecretEventInvalid)
|
||||
}
|
||||
}
|
||||
if len(s.Events) == 0 {
|
||||
|
Reference in New Issue
Block a user