You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/pkg/webhooks/README.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ method in the caller code based on the event.
50
50
51
51
#### Optional webhooks events
52
52
53
-
In the event that there are multiple events to be configured, for example `OnProjectCreated` and `OnProjectUpdated`, and only `OnProjectCreated` webhooks should be fired, use the `IsEventConfigured()` method provided by the `WebhookManager` to check if the event is set before calling `InvokeWebhooks()`
53
+
In the event that there are multiple events to be configured, for example `OnProjectCreated` and `OnProjectUpdated`, use the `IsEventConfigured()` method provided by the `WebhookManager` to check if the event `OnProjectUpdated`is set before calling `InvokeWebhooks()` for the `OnProjectUpdated`. If this check is not performed, the `OnProjectUpdated` event must always be configured in the webhooks configuration if webhooks are enabled.
54
54
55
55
For example:
56
56
@@ -65,6 +65,33 @@ For example:
65
65
}, webhooks.NoOpErrorHandler)
66
66
}
67
67
```
68
+
example config:
69
+
```yaml
70
+
webhooks:
71
+
enabled: true
72
+
config:
73
+
OnProjectCreated:
74
+
- url: http://localhost:8081/project_created
75
+
method: POST
76
+
finalResponse: true
77
+
name: webhook1
78
+
OnProjectUpdated: # <-- this must always be set if no check is performed before InvokeWebhooks() is called
79
+
- url: http://localhost:8081/project_updated
80
+
method: POST
81
+
finalResponse: true
82
+
name: webhook2
83
+
```
84
+
Checking if the event exists allows users to just specify a subset of the events available, in this case only `OnProjectCreated` is set.
0 commit comments