Skip to content

Commit

Permalink
Check webhook secret for entity
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
  • Loading branch information
gabriel-samfira committed Mar 18, 2024
1 parent e3ffc15 commit ec42482
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runner/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func NewEntityPoolManager(ctx context.Context, entity params.GithubEntity, cfgIn
return nil, errors.Wrap(err, "getting github client")
}

if entity.WebhookSecret == "" {
return nil, errors.New("webhook secret is empty")
}

wg := &sync.WaitGroup{}
keyMuxes := &keyMutex{}

Expand Down Expand Up @@ -1689,7 +1693,9 @@ func (r *basePoolManager) Stop() error {
func (r *basePoolManager) RefreshState(param params.UpdatePoolStateParams) error {
r.mux.Lock()

r.entity.WebhookSecret = param.WebhookSecret
if param.WebhookSecret != "" {
r.entity.WebhookSecret = param.WebhookSecret
}
if param.InternalConfig != nil {
r.cfgInternal = *param.InternalConfig
}
Expand Down

0 comments on commit ec42482

Please sign in to comment.