tektoncd / community

Community documentation for the Tekton project
https://tekton.dev
Apache License 2.0
360 stars 221 forks source link

Triggering pipelines based on the commit happening in various folders #1128

Closed AshwinSridharan0410 closed 4 months ago

AshwinSridharan0410 commented 5 months ago

So, the usecase of mine is to have a preprocessor which triggers the pipeline based on the commit . The repo structure would be a monorepo wherein there will be multiple folders having their own functionalities. For example, My repo structure would be for a cafe application. There are multiple folders at the root of the repo :- | Login | Logout | Payments | Design

So, if someone makes changes to various folders in a single commit, automatically pipelines should be triggered for the multiple folders changed. Say, if there were changes to the directories/folders of Login,Logout in a single commit-> it should trigger two pipelines I am currently using tekton pipelines version - > 0.35 tekton triggers version - > 0.21

AlanGreene commented 5 months ago

Hi @AshwinSridharan0410, this is possible today using Tekton Triggers. You can specify multiple Triggers to respond to the event. See the EventListener documentation for details: https://tekton.dev/docs/triggers/eventlisteners/

Also see the Interceptors doc for an example of filtering a GitHub event based on the changed files: https://tekton.dev/docs/triggers/interceptors/#adding-changed-files