{{ if has "github" .Values.global.gitProviders }}
apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerBinding
metadata:
  name: github-binding-review
  labels:
    {{- include "edp-tekton.labels" . | nindent 4 }}
spec:
  params:
    - name: gitrevision
      value: $(extensions.pullRequest.headRef)
    - name: gitrepositoryurl
      value: $(body.repository.ssh_url)
    - name: gitrepositoryname
      value: $(body.repository.name)
    - name: gitfullrepositoryname
      value: $(body.repository.full_name)
    - name: gitsha
      value: $(extensions.pullRequest.headSha)
    - name: targetBranch
      value: "$(extensions.targetBranch)"
    - name: changeNumber
      value: "$(extensions.pullRequest.changeNumber)"
    - name: commitMessage
      value: "$(extensions.pullRequest.lastCommitMessage)"
    - 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 }}
