{{ if has "gerrit" .Values.global.gitProviders }}
apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerBinding
metadata:
  name: gerrit-binding-review
  labels:
    {{- include "edp-tekton.labels" . | nindent 4 }}
spec:
  params:
    - name: gitrevision
      value: "FETCH_HEAD"
    - name: gerritproject
      value: "$(body.change.project)"
    - name: gerritrefspec
      value: "$(body.patchSet.ref)"
    - name: targetBranch
      value: "$(body.change.branch)"
    - name: changeNumber
      value: "$(body.change.number)"
    - name: patchsetNumber
      value: "$(body.patchSet.number)"
    - name: commitMessage
      value: "$(body.change.commitMessage)"
    - name: commitMessagePattern
      value: "$(extensions.spec.commitMessagePattern)"
    - name: codebase
      value: "$(extensions.codebase)"
    - name: codebasebranch
      value: "$(extensions.codebasebranch)"
    # get the pipeline name from the codebasebranch spec
    - name: pipelineName
      value: $(extensions.pipelines.review)
{{ end }}
