Skip to content

Commit 731820c

Browse files
committed
fix: include branch filter in CEL expression for release trigger
The on-cel-expression annotation takes precedence over on-event and on-target-branch annotations. The previous CEL expression only checked body.created == true, which matched ANY newly created branch push (e.g. fix/CVE-* branches), not just release-v* branches. Add the branch filter directly in the CEL expression to ensure the release pipeline only triggers for release-v* branch creation.
1 parent dafd94c commit 731820c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.tekton/release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ metadata:
2828
# Trigger on push events to release branches, but ONLY when the branch
2929
# is first created (body.created == true). This means it fires exactly
3030
# once per release branch, not on every commit pushed to it.
31+
# NOTE: on-cel-expression takes precedence over on-event/on-target-branch,
32+
# so the branch filter MUST be included in the CEL expression.
3133
pipelinesascode.tekton.dev/on-event: "[push]"
3234
pipelinesascode.tekton.dev/on-target-branch: "[refs/heads/release-v*]"
33-
pipelinesascode.tekton.dev/on-cel-expression: "body.created == true"
35+
pipelinesascode.tekton.dev/on-cel-expression: >
36+
body.created == true && pac.target_branch.startsWith("refs/heads/release-v")
3437
pipelinesascode.tekton.dev/pipeline: "tekton/operator-release-pipeline.yaml"
3538
pipelinesascode.tekton.dev/max-keep-runs: "5"
3639
spec:

0 commit comments

Comments
 (0)