argoproj / argo-events

Event-driven Automation Framework for Kubernetes
https://argoproj.github.io/argo-events/
Apache License 2.0
2.38k stars 741 forks source link

Limit Triggers To a branch or Pull Requests #1605

Open MazenElzanaty opened 2 years ago

MazenElzanaty commented 2 years ago

Is your feature request related to a problem? Please describe. Currently I'm using argo workflows to build and push a docker image, so I only want to do that for a specific branch

Describe the solution you'd like A way to limit the events in the event source to branches

whynowy commented 2 years ago

You can use the filtering feature in either eventsource or sensor.

https://github.com/argoproj/argo-events/blob/master/docs/eventsources/filtering.md

https://github.com/argoproj/argo-events/tree/master/docs/sensors/filters

iamnst19 commented 1 month ago

@whynowy can you please provide a sample I can use for bitbucket? Tried this but now working.

filter:
  data:
    - path: "ref" # Path to the branch reference in the event payload
      type: "string"
      value:
        - "refs/heads/release" # The branch name you want to match