tektoncd / triggers

Event triggering with Tekton!
Apache License 2.0
552 stars 416 forks source link

Example doesn't work well with both SSH and HTTPS enabled in Bitbucket #1640

Closed af-wieda closed 11 months ago

af-wieda commented 11 months ago

https://github.com/tektoncd/triggers/blob/cc1b7b73f165e9480f0cd92ac0b0f36e0f0be3e0/examples/v1beta1/bitbucket-server/triggerbinding.yaml#L11C1-L11C52

When Bitbucket server has both SSH and HTTPS cloning enabled, the default clone-tasks may fail because of unpredictable order of the hrefs in the array from the webhook payload.

Using this kind of expression to always get the ssh href (example for pullreq) is safer:

$(body.pullRequest.fromRef.repository.links.clone[?(@.name=="ssh")].href)

Best regards, David

khrm commented 11 months ago

/assign @khrm

khrm commented 11 months ago

/kind bug

khrm commented 11 months ago

Thanks for reporting this issue, I have raised a pr with your fix.

khrm commented 11 months ago

Fixed by #1641