Open tppalani opened 1 year ago
Hi @savitaashture can you please help me on this.
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
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.
@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?
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
with a justification.
Mark the issue as fresh with /remove-lifecycle rotten
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/close
Send feedback to tektoncd/plumbing.
Hi Team,
1) I have successfully configured Event listener with bitbucket server. 2) But the problem is when new changes has been detected inside my repository pipeline getting triggered, Instead i want trigger the pipeline when the changes has merged or committed in only master branch.
Here the code.
Trigger-binding.yaml
Eventlistener.yaml
Trigger template