Giter VIP home page Giter VIP logo

Comments (5)

tppalani avatar tppalani commented on August 17, 2024

Hi @savitaashture can you please help me on this.

from triggers.

vinamra28 avatar vinamra28 commented on August 17, 2024

hi @tppalani, probably one interceptor won't work alone, you'll have to use CEL expressions as well in order to filter the request based on custom requirements such as

    - ref:
        name: "cel"
      params:
        - name: "filter"
          value: body.ref == 'refs/heads/main'

so your resultant EventListener would turn up as

apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
  name: bitbucket-event-listener
  namespace: devops
spec:
  serviceAccountName: tekton-triggers-example-sa
  triggers:
    - name: bitbucket-trigger-binding
      interceptors:
        - ref:
            name: "bitbucket"
          params:
            - name: secretRef
              value: null
            - name: eventTypes
              value:
                - repo:refs_changed
        - ref:
              name: "cel"
           params:
            - name: "filter"
              value: body.ref == 'refs/heads/main'
      bindings:
        - ref: bitbucket-trigger-binding
      template:
        ref: bitbucket-trigger-template

@dibyom @savitaashture @khrm please correct me if I missed something here

from triggers.

tppalani avatar tppalani commented on August 17, 2024

Hi @vinamra28 Thanks for the quick response. As per your instruction i have updated my event listener yaml file but now the pipeline is not getting triggered if target branch updated.

from triggers.

dibyom avatar dibyom commented on August 17, 2024

@tppalani just making sure - @vinamra28 's example used value: body.ref == 'refs/heads/main' - if you branch name is master, you'd want to use refs/heads/master.
If that is not the issue, then could you please provide logs from the eventlistener?

from triggers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.