Skip to content

Commit 4edda50

Browse files
committed
added more fields in webhook notification
1 parent bd387d8 commit 4edda50

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
.env
55
/cmd/external-app/devtron-ea
66
devtron
7+
8+
.qodo

pkg/notifier/WebhookNotificationService.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ func (impl *WebhookNotificationServiceImpl) GetWebhookVariables() (map[string]be
109109
"devtronCiPipelineId": beans.DevtronCiPipelineId,
110110
"devtronCdPipelineId": beans.DevtronCdPipelineId,
111111
"devtronTriggeredByEmail": beans.DevtronTriggeredByEmail,
112+
"devtronPipelineType": beans.DevtronPipelineType,
113+
"devtronBuildGitCommitHash": beans.DevtronBuildGitCommitHash,
112114
"eventType": beans.EventType,
113115
}
114116

@@ -119,7 +121,7 @@ func (impl *WebhookNotificationServiceImpl) FetchAllWebhookNotificationConfig()
119121
var responseDto []*beans.WebhookConfigDto
120122
webhookConfigs, err := impl.webhookRepository.FindAll()
121123
if err != nil && !util.IsErrNoRows(err) {
122-
impl.logger.Errorw("cannot find all webhoook config", "err", err)
124+
impl.logger.Errorw("cannot find all webhook config", "err", err)
123125
return []*beans.WebhookConfigDto{}, err
124126
}
125127
for _, webhookConfig := range webhookConfigs {

pkg/notifier/beans/beans.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const (
2323
DevtronCiPipelineId WebhookVariable = "{{devtronCiPipelineId}}"
2424
DevtronCdPipelineId WebhookVariable = "{{devtronCdPipelineId}}"
2525
DevtronTriggeredByEmail WebhookVariable = "{{devtronTriggeredByEmail}}"
26+
DevtronBuildGitCommitHash WebhookVariable = "{{devtronBuildGitCommitHash}}"
27+
DevtronPipelineType WebhookVariable = "{{devtronPipelineType}}"
2628
EventType WebhookVariable = "{{eventType}}"
2729
)
2830

0 commit comments

Comments
 (0)