Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neutrinet
infra-ansible
Commits
d7040a0d
Commit
d7040a0d
authored
Jan 15, 2022
by
HgO
Browse files
accept ping event and remove unused gitlab config
parent
b7b5aa24
Pipeline
#665
canceled with stage
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/webhook/templates/webhook/config.yml.j2
View file @
d7040a0d
...
@@ -13,38 +13,35 @@
...
@@ -13,38 +13,35 @@
command-working-directory: "{{ webhook_working_dir }}"
command-working-directory: "{{ webhook_working_dir }}"
trigger-rule-mismatch-http-response-code: 401
trigger-rule-mismatch-http-response-code: 401
trigger-rule:
trigger-rule:
# signature ok AND (event == ping OR (event == push AND ref == correct branch))
and:
and:
- match:
# Always check Github signature before doing anything
type: value
value: "{{ webhook_git_ref }}"
parameter:
source: payload
name: ref
{% if webhook_type == "github" %}
- match:
- match:
type: payload-hash-sha256
type: payload-hash-sha256
secret: {{ webhook_token | string | to_json }}
secret: {{ webhook_token | string | to_json }}
parameter:
parameter:
source: header
source: header
name: X-Hub-Signature-256
name: X-Hub-Signature-256
- match:
- or:
type: value
# Either accept ping or push events
value: push
- match:
parameter:
type: value
source: header
value: ping
name: X-GitHub-Event
parameter:
{% elif webhook_type == "gitlab" %}
source: header
and:
name: X-GitHub-Event
- match:
# If it's a push event...
type: value
- and:
value: {{ webhook_token | string | to_json }}
- match:
parameter:
type: value
source: header
value: push
name: X-Gitlab-Token
parameter:
- match:
source: header
type: value
name: X-GitHub-Event
value: Push Hook
# Check also that the webhook is run against the correct branch or tag
parameter:
- match:
source: header
type: value
name: X-Gitlab-Event
value: "{{ webhook_git_ref }}"
{% endif %}
parameter:
source: payload
name: ref
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment