feat: support template variables in webhook deployment
This commit is contained in:
@@ -367,23 +367,9 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return nil, nil, fmt.Errorf("failed to unmarshal access config: %w", err)
|
||||
}
|
||||
|
||||
variables := make(map[string]string)
|
||||
if deployConfig != nil {
|
||||
value, ok := deployConfig["variables"]
|
||||
if ok {
|
||||
kvs := make([]domain.KV, 0)
|
||||
bts, _ := json.Marshal(value)
|
||||
if err := json.Unmarshal(bts, &kvs); err == nil {
|
||||
for _, kv := range kvs {
|
||||
variables[kv.Key] = kv.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deployer, err := providerWebhook.NewWithLogger(&providerWebhook.WebhookDeployerConfig{
|
||||
Url: access.Url,
|
||||
Variables: variables,
|
||||
WebhookUrl: access.Url,
|
||||
WebhookData: maps.GetValueAsString(deployConfig, "webhookData"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user