cluster.fun/tekton/eventlisteners/webhook.yaml

56 lines
1.5 KiB
YAML
Raw Normal View History

2020-04-25 18:18:33 +00:00
apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
metadata:
name: webhook-listener
namespace: tekton-pipelines
spec:
serviceAccountName: eventlistener
triggers:
- name: pull-request
interceptors:
- cel:
filter: "header.match('X-GitHub-Event', 'pull_request') && body.action != 'closed'"
overlays:
- key: commit_sha
expression: "body.pull_request.head.sha"
- key: branch
expression: "body.pull_request.head.ref"
- key: ref
expression: "body.pull_request.head.ref"
bindings:
- name: gitea-binding
template:
name: pr-project
- name: deploy-master
interceptors:
- cel:
filter: "header.match('X-GitHub-Event', 'push') && body.ref.split('/')[2] == body.repository.default_branch"
2020-04-25 18:18:33 +00:00
overlays:
- key: commit_sha
expression: "body.after"
- key: branch
expression: "body.ref.split('/')[2]"
2020-04-25 18:18:33 +00:00
- key: ref
expression: "body.ref"
2020-05-07 16:06:08 +00:00
- key: number
expression: "0"
2020-04-25 18:18:33 +00:00
bindings:
- name: gitea-binding
template:
name: deploy-project
- name: tag
interceptors:
- cel:
filter: "header.match('X-GitHub-Event', 'create') && body.ref_type == 'tag'"
overlays:
- key: commit_sha
expression: "body.sha"
- key: ref
expression: "body.ref"
2020-05-07 16:06:08 +00:00
- key: number
expression: "0"
2020-04-25 18:18:33 +00:00
bindings:
- name: gitea-binding
template:
name: project-tag