---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: push-pr
  annotations:
    pipelinesascode.tekton.dev/on-cel-expression: |
      event == "push" && target_branch == "main" && body.actor.name == "user_name"

spec:
  params:
    - name: repo_url
      value: "{{ repo_url }}"
    - name: revision
      value: "{{ revision }}"
    - name: changes
      value: "{{body.changes[0].ref.id}}"

  pipelineSpec:
    params:
      - name: repo_url
      - name: revision
    tasks:
        - name: task
          displayName: "The Task name is Task"
          taskSpec:
            steps:
              - name: task
                image: registry.access.redhat.com/ubi9/ubi-micro
                command: ["/bin/echo", "$(params.changes)"]

