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 @@
command-working-directory: "{{ webhook_working_dir }}"
trigger-rule-mismatch-http-response-code: 401
trigger-rule:
# signature ok AND (event == ping OR (event == push AND ref == correct branch))
and:
- match:
type: value
value: "{{ webhook_git_ref }}"
parameter:
source: payload
name: ref
{% if webhook_type == "github" %}
# Always check Github signature before doing anything
- match:
type: payload-hash-sha256
secret: {{ webhook_token | string | to_json }}
parameter:
source: header
name: X-Hub-Signature-256
- match:
type: value
value: push
parameter:
source: header
name: X-GitHub-Event
{% elif webhook_type == "gitlab" %}
and:
- match:
type: value
value: {{ webhook_token | string | to_json }}
parameter:
source: header
name: X-Gitlab-Token
- match:
type: value
value: Push Hook
parameter:
source: header
name: X-Gitlab-Event
{% endif %}
- or:
# Either accept ping or push events
- match:
type: value
value: ping
parameter:
source: header
name: X-GitHub-Event
# If it's a push event...
- and:
- match:
type: value
value: push
parameter:
source: header
name: X-GitHub-Event
# Check also that the webhook is run against the correct branch or tag
- match:
type: value
value: "{{ webhook_git_ref }}"
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