Commit d7040a0d authored by HgO's avatar HgO
Browse files

accept ping event and remove unused gitlab config

parent b7b5aa24
Pipeline #665 canceled with stage
in 57 seconds
...@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment