Skip to content

fix: include branch filter in CEL expression for release trigger#3335

Merged
tekton-robot merged 1 commit intotektoncd:mainfrom
vdemeester:fix-cel-release-branch-filter
Apr 7, 2026
Merged

fix: include branch filter in CEL expression for release trigger#3335
tekton-robot merged 1 commit intotektoncd:mainfrom
vdemeester:fix-cel-release-branch-filter

Conversation

@vdemeester
Copy link
Copy Markdown
Member

@vdemeester vdemeester commented Apr 7, 2026

Changes

The on-cel-expression annotation takes precedence over on-event and
on-target-branch annotations in Pipelines-as-Code. 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.

This caused spurious release PipelineRuns to be created when non-release
branches were pushed to the repo.

Include the branch filter directly in the CEL expression:

pipelinesascode.tekton.dev/on-cel-expression: >
  body.created == true && pac.target_branch.startsWith("refs/heads/release-v")

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 7, 2026
@tekton-robot tekton-robot requested review from jkhelil and khrm April 7, 2026 11:30
@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Apr 7, 2026
@tekton-as-code
Copy link
Copy Markdown

tekton-as-code bot commented Apr 7, 2026

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
release-pipeline CEL expression evaluation error: expression "body.created == true" failed to evaluate: no such key: created

@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-none Denotes a PR that doesnt merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 7, 2026
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.
@jkhelil
Copy link
Copy Markdown
Member

jkhelil commented Apr 7, 2026

/approve

@jkhelil
Copy link
Copy Markdown
Member

jkhelil commented Apr 7, 2026

/lgtm

@tekton-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkhelil

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 7, 2026
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 7, 2026
@tekton-robot tekton-robot merged commit 43d2c0d into tektoncd:main Apr 7, 2026
16 checks passed
@jkhelil
Copy link
Copy Markdown
Member

jkhelil commented Apr 7, 2026

/cherry-pick release-v0.79.x
/cherry-pick release-v0.78.x
/cherry-pick release-v0.77.x
/cherry-pick release-v0.71.x

@tekton-robot
Copy link
Copy Markdown
Contributor

Cherry-pick to release-v0.79.x failed!

The automatic cherry-pick to release-v0.79.x failed.

Output:

🤖 Starting cherry-pick process...
Fetching PR #3335 information...
Found merge commit: 43d2c0dde412625c70426003336145adcf30fc5d
PR title: fix: include branch filter in CEL expression for release trigger
Fetching target branch: release-v0.79.x...
From https://github.com/tektoncd/operator
 * branch                release-v0.79.x -> FETCH_HEAD
Checking for existing cherry-pick PR...
Creating cherry-pick branch: cherry-pick-3335-to-release-v0.79.x...
Switched to a new branch 'cherry-pick-3335-to-release-v0.79.x'
branch 'cherry-pick-3335-to-release-v0.79.x' set up to track 'origin/release-v0.79.x'.
Fetching commits from PR #3335...
Found 1 commit(s) to cherry-pick
Fetching PR ref to make fork commits available locally...
From https://github.com/tektoncd/operator
 * branch                refs/pull/3335/head -> FETCH_HEAD
Cherry-picking commit 1/1: 66711fda7c285dd25122c28558563ecaa27db84d...
CONFLICT (modify/delete): .tekton/release.yaml deleted in HEAD and modified in 66711fda7 (fix: include branch filter in CEL expression for release trigger).  Version 66711fda7 (fix: include branch filter in CEL expression for release trigger) of .tekton/release.yaml left in tree.
error: could not apply 66711fda7... fix: include branch filter in CEL expression for release trigger
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
❌ ERROR: Cherry-pick failed for commit 66711fda7c285dd25122c28558563ecaa27db84d due to conflicts or other errors

Next steps:

  • Check the action logs for complete details
  • If the PR is not merged, merge it first and try again
  • If there are conflicts, you'll need to manually cherry-pick this PR

@vdemeester vdemeester deleted the fix-cel-release-branch-filter branch April 7, 2026 14:13
@vdemeester
Copy link
Copy Markdown
Member Author

@jkhelil not required to cherry pick (but we will need tektoncd/pipelines-as-code#2647 to get the patch release work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants