Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-3935

event_title.startsWith() is not working for pull_request event type

XMLWordPrintable

    • Pipelines Sprint 252

      Description of problem:

       pipelineRuns are not triggering for pull_request events when user use event_title.startsWith() but it seems to work fine for pushes though.  Example pipelines are below

      ---
      apiVersion: tekton.dev/v1beta1
      kind: PipelineRun
      metadata:
        name: no-op
        annotations:
          pipelinesascode.tekton.dev/on-cel-expression: >-
            event == 'pull_request' && event_title.startsWith("skip")
      spec:
        params:
          # The variable with brackets are special to Pipelines as Code
          # They will automatically be expanded with the events from Github.
          - name: repo_url
            value: "{{ repo_url }}"
          - name: event_data
            value: "{{ event_type }}"
          - name: revision
            value: "{{ revision }}"
          - name: title
            value: "{{ event_title }}"
        pipelineSpec:
          params:
            - name: repo_url
            - name: revision
            - name: event_data
            - name: title
          tasks:
            # Customize this task if you like, or just do a taskRef
            # to one of the hub task.
            - name: noop-task
              taskSpec:
                results:
                  - name: OUTPUT
                steps:
                  - name: noop-task
                    image: registry.access.redhat.com/ubi9/ubi-micro
      
                    script: |
                      echo "**********************"
                      echo $(params.repo_url)
                      echo "**********************"
                      echo $(params.event_data)
                      echo "**********************"
                      echo $(params.title)
                      echo "**********************"
                      exit 0 

       Reported by FORD

      Slack: https://tektoncd.slack.com/archives/C04BL0X1MU3/p1701281914420969

              sashture Savita .
              sashture Savita .
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 2 minutes
                  2m
                  Remaining:
                  Remaining Estimate - 2 minutes
                  2m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified