@@ -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,16 +1693,17 @@ func (r *basePoolManager) Stop() error {
16891693func (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
1695- }
1696-
1697- r .urls = urls {
1698- webhookURL : r .cfgInternal .BaseWebhookURL ,
1699- callbackURL : r .cfgInternal .InstanceCallbackURL ,
1700- metadataURL : r .cfgInternal .InstanceMetadataURL ,
1701- controllerWebhookURL : r .cfgInternal .ControllerWebhookURL ,
1701+ r .urls = urls {
1702+ webhookURL : r .cfgInternal .BaseWebhookURL ,
1703+ callbackURL : r .cfgInternal .InstanceCallbackURL ,
1704+ metadataURL : r .cfgInternal .InstanceMetadataURL ,
1705+ controllerWebhookURL : r .cfgInternal .ControllerWebhookURL ,
1706+ }
17021707 }
17031708
17041709 ghc , err := garmUtil .GithubClient (r .ctx , r .entity , r .cfgInternal .GithubCredentialsDetails )
0 commit comments