Currently on each new commit to a MR a pipeline will be triggered, even the build is not always required.
Example:
Source code will be changed => Pipeline should be triggered
Readme will be updated => No need to test the source code
Possibile solutions to retrieve changed files:
Run a git diff with gitlabSourceBranch& gitlabTargetBranch => requires a checkout
Use aggregated list of modified/added/deleted files from webhook
How to skip job
Option 1) Add an API to retrieve and maybe filter the aggregated file list, so you can skip stages via when
Option 2) Add a new trigger filter (similar to the combination of branchFilterType: 'NameBasedFilter' with includeBranchesSpec: '...')
Option 1 is more flexible, as you can e.g. skip some stages, but not all (e.g. run doxygen, but don't run tests). Option 2 has the benefit that a job can bypass the job queue, but requires to think also about what happens with the defined build within gitlabBuilds.
"I hope to add a trigger based on the modification event of a specific file in the repo." example repo when the workspace file in the repo is updated."
Currently on each new commit to a MR a pipeline will be triggered, even the build is not always required.
Example:
Possibile solutions to retrieve changed files:
gitlabSourceBranch
&gitlabTargetBranch
=> requires a checkoutHow to skip job
branchFilterType: 'NameBasedFilter'
withincludeBranchesSpec: '...'
)Option 1 is more flexible, as you can e.g. skip some stages, but not all (e.g. run doxygen, but don't run tests). Option 2 has the benefit that a job can bypass the job queue, but requires to think also about what happens with the defined build within
gitlabBuilds
.