File: hooks.yaml.tmpl

package info (click to toggle)
webhook 2.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 11,064 kB
  • sloc: asm: 1,650; sh: 620; xml: 88; makefile: 50; ansic: 24
file content (316 lines) | stat: -rw-r--r-- 7,474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
- id: github
  http-methods:
  - "Post "
  trigger-rule:
    and:
    - match:
        parameter:
          source: header
          name: X-Hub-Signature
        secret: mysecret
        type: payload-hmac-sha1
    - match:
        parameter:
          source: payload
          name: ref
        type: value
        value: refs/heads/master
  include-command-output-in-response: true
  trigger-rule-mismatch-http-response-code: 400
  execute-command: '{{ .Hookecho }}'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: head_commit.author.email
  pass-environment-to-command:
  - source: payload
    name: head_commit.timestamp
  command-working-directory: /

- id: github-multi-sig
  http-methods:
  - "Post "
  trigger-rule:
    and:
    - or:
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecretFAIL
          type: payload-hmac-sha1
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecret
          type: payload-hmac-sha1
    - match:
        parameter:
          source: payload
          name: ref
        type: value
        value: refs/heads/master
  include-command-output-in-response: true
  trigger-rule-mismatch-http-response-code: 400
  trigger-signature-soft-failures: true
  execute-command: '{{ .Hookecho }}'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: head_commit.author.email
  pass-environment-to-command:
  - source: payload
    name: head_commit.timestamp
  command-working-directory: /

- id: github-multi-sig-fail
  http-methods:
  - "Post "
  trigger-rule:
    and:
    - or:
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecretFAIL
          type: payload-hmac-sha1
      - match:
          parameter:
            source: header
            name: X-Hub-Signature
          secret: mysecret
          type: payload-hmac-sha1
    - match:
        parameter:
          source: payload
          name: ref
        type: value
        value: refs/heads/master
  include-command-output-in-response: true
  trigger-rule-mismatch-http-response-code: 400
  execute-command: '{{ .Hookecho }}'
  pass-arguments-to-command:
  - source: payload
    name: head_commit.id
  - source: payload
    name: head_commit.author.email
  pass-environment-to-command:
  - source: payload
    name: head_commit.timestamp
  command-working-directory: /

- id: bitbucket
  trigger-rule:
    and:
    - match:
        parameter:
          source: payload
          name: payload.canon_url
        type: value
        value: https://bitbucket.org
    - match:
        parameter:
          source: payload
          name: payload.repository.absolute_url
        type: value
        value: /webhook/testing/
    - match:
        parameter:
          source: payload
          name: payload.commits.0.branch
        type: value
        value: master
  parse-parameters-as-json:
  - source: payload
    name: payload
  trigger-rule-mismatch-http-response-code: 999
  execute-command: '{{ .Hookecho }}'
  response-message: success
  include-command-output-in-response: false
  command-working-directory: /

- id: gitlab
  trigger-rule:
    match:
      parameter:
        source: payload
        name: ref
      type: value
      value: refs/heads/master
  pass-arguments-to-command:
  - source: payload
    name: commits.0.id
  - source: payload
    name: user_name
  - source: payload
    name: user_email
  execute-command: '{{ .Hookecho }}'
  response-message: success
  include-command-output-in-response: true
  command-working-directory: /

- id: xml
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  response-message: success
  trigger-rule:
    and:
    - match:
        type: value
        parameter:
          source: payload
          name: app.users.user.0.-name
        value: Jeff
    - match:
        type: value
        parameter:
          source: payload
          name: "app.messages.message.#text"
        value: "Hello!!"

- id: txt-raw
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  include-command-output-in-response: true
  pass-arguments-to-command:
  - source: raw-request-body

- id: sendgrid
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  response-message: success
  trigger-rule:
    match:
      type: value
      parameter:
        source: payload
        name: root.0.event
      value: processed

- id: sendgrid/dir
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  response-message: success
  trigger-rule:
    match:
      type: value
      parameter:
        source: payload
        name: root.0.event
      value: it worked!

- id: plex
  trigger-rule:
    match:
      type: value
      parameter:
        source: payload
        name: payload.event
      value: media.play
  parse-parameters-as-json:
  - source: payload
    name: payload
  execute-command: '{{ .Hookecho }}'
  response-message: success
  command-working-directory: /

- id: capture-command-output-on-success-not-by-default
  pass-arguments-to-command:
  - source: string
    name: exit=0
  execute-command: '{{ .Hookecho }}'

- id: capture-command-output-on-success-yes-with-flag
  pass-arguments-to-command:
  - source: string
    name: exit=0
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true

- id: capture-command-output-on-error-not-by-default
  pass-arguments-to-command:
  - source: string
    name: exit=1
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true

- id: capture-command-output-on-error-yes-with-extra-flag
  pass-arguments-to-command:
  - source: string
    name: exit=1
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true
  include-command-output-in-response-on-error: true

- id: request-source
  pass-arguments-to-command:
  - source: request
    name: method
  - source: request
    name: remote-addr
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true

- id: static-params-ok
  execute-command: '{{ .Hookecho }}'
  include-command-output-in-response: true
  pass-arguments-to-command:
  - source: string
    name: passed

- id: warn-on-space
  execute-command: '{{ .Hookecho }} foo'
  include-command-output-in-response: true

- id: issue-471
  execute-command: '{{ .Hookecho }}'
  response-message: success
  trigger-rule:
    or:
    - match:
        parameter:
          source: payload
          name: foo
        type: value
        value: bar
    - match:
        parameter:
          source: payload
          name: exists
        type: value
        value: 1

- id: issue-471-and
  execute-command: '{{ .Hookecho }}'
  response-message: success
  trigger-rule:
    and:
    - match:
        parameter:
          source: payload
          name: foo
        type: value
        value: bar
    - match:
        parameter:
          source: payload
          name: exists
        type: value
        value: 1

- id: empty-payload-signature
  include-command-output-in-response: true
  execute-command: '{{ .Hookecho }}'
  command-working-directory: /
  trigger-rule:
    and:
    - match:
        parameter:
          source: header
          name: X-Hub-Signature
        secret: mysecret
        type: payload-hmac-sha1