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

The merge of a PR ("pull_request.closed" action) causes the PipelineRun previously created via the PR creation ("pull_request.opened") to be cancelled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • Pipelines 1.18.0
    • Pipelines as Code
    • None
    • Hide
      • Install Pipeline as a Code
      • Create a Repository resource
      • Create a .tekton/pipelinerun.yaml configuration file in the GitHub repository, something like:
        ---
        apiVersion: tekton.dev/v1
        kind: PipelineRun
        metadata:
          name: test-pac
          annotations:
            pipelinesascode.tekton.dev/on-event: "[pull_request, push]"
            pipelinesascode.tekton.dev/on-target-branch: "[main]"
            pipelinesascode.tekton.dev/max-keep-runs: "5"
        spec:
          params:
            - name: repo_url
              value: "{{ repo_url }}"
            - name: revision
              value: "{{ revision }}"
          pipelineSpec:
            params:
              - name: repo_url
              - name: revision
            tasks:
              - name: noop-task
                displayName: Task with no effect
                taskSpec:
                  steps:
                    - name: noop-task
                      image: registry.access.redhat.com/ubi9/ubi-micro
                      script: |
                        echo $(params.repo_url)
                        echo $(params.revision)
                        sleep 600
                        exit 0 

         

      • Create a new branch, modify the source code, and push the modification upstream:
        git checkout -b test-branch 
        echo test >> README.md
        git add .
        git commit -m "test $(date '+%Y-%m-%dT%H:%M:%S')"
         git push --set-upstream origin test-branch
      • Create a pull request for 'test-branch' on GitHub by visiting: https://github.com/<USERNAME>/<REPOSITORY>/pull/new/test-branch
      • The creation of a PR will trigger a new PipelineRun execution
      • The merge of the same PR will cause the above PipelineRun to be cancelled
      Show
      Install Pipeline as a Code Create a Repository resource Create a .tekton/pipelinerun.yaml configuration file in the GitHub repository, something like: --- apiVersion: tekton.dev/v1 kind: PipelineRun metadata:   name: test-pac   annotations:     pipelinesascode.tekton.dev/on-event: "[pull_request, push]"     pipelinesascode.tekton.dev/on-target-branch: "[main]"     pipelinesascode.tekton.dev/max-keep-runs: "5" spec:   params:     - name: repo_url       value: "{{ repo_url }}"     - name: revision       value: "{{ revision }}"   pipelineSpec:     params:       - name: repo_url       - name: revision     tasks:       - name: noop-task         displayName: Task with no effect         taskSpec:           steps:             - name: noop-task               image: registry.access.redhat.com/ubi9/ubi-micro               script: |                 echo $(params.repo_url)                 echo $(params.revision)                 sleep 600                 exit 0   Create a new branch, modify the source code, and push the modification upstream: git checkout -b test-branch echo test >> README.md git add . git commit -m "test $(date '+%Y-%m-%dT%H:%M:%S' )" git push --set-upstream origin test-branch Create a pull request for 'test-branch' on GitHub by visiting: https://github.com/ <USERNAME>/<REPOSITORY>/pull/new/test-branch The creation of a PR will trigger a new PipelineRun execution The merge of the same PR will cause the above PipelineRun to be cancelled
    • Customer Reported
    • Red Hat OpenShift Pipelines

      The merge of a PR (GitHub Payload {action": "closed"}) causes the PipelineRun previously created via the PR creation (GitHub Payload {action": "opened"}) to be cancelled.

              Unassigned Unassigned
              rhn-support-gmeghnag Gabriel Meghnagi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: