Skip to content

Commit ec42482

Browse files
Check webhook secret for entity
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
1 parent e3ffc15 commit ec42482

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

runner/pool/pool.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ func NewEntityPoolManager(ctx context.Context, entity params.GithubEntity, cfgIn
102102
return nil, errors.Wrap(err, "getting github client")
103103
}
104104

105+
if entity.WebhookSecret == "" {
106+
return nil, errors.New("webhook secret is empty")
107+
}
108+
105109
wg := &sync.WaitGroup{}
106110
keyMuxes := &keyMutex{}
107111

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

1692-
r.entity.WebhookSecret = param.WebhookSecret
1696+
if param.WebhookSecret != "" {
1697+
r.entity.WebhookSecret = param.WebhookSecret
1698+
}
16931699
if param.InternalConfig != nil {
16941700
r.cfgInternal = *param.InternalConfig
16951701
}

0 commit comments

Comments
 (0)