Create conditional pipelines with CEL
Camilla Conte
Fri, 07/22/2022 – 03:00
Register or Login to like
Register or Login to like
You just followed a guide to start your Tekton pipeline (or task) when a merge request is created or updated on your GitLab project. So you configured GitLab to send merge request events as webhooks. And you deployed some Tekton components:
EventListener: receives webhooks from GitLab
Trigger: starts your Pipeline every time the EventListener receives a new webhook from GitLab
Pipeline: fetches the source code from GitLab and builds it
Then you notice that any event in your merge request (a new comment, a tag change) triggers the pipeline. That’s not the behavior you desire. You don’t need to build a comment or a tag, after all. You only want the pipeline to run when there is actual new code to build. Here’s how I use Tekton’s CEL Interceptor to create conditionals for my … // Read more: original article.