Gitlab CI – How to trigger a build only if changes happen on particular set of files
In Gitlab CI, how do you trigger a build only if changes happen on particular set of files?
Is there a way to either include or exclude certain files from triggering a build? For eg: updating
README.md, .gitignore files should not cause a build to trigger.
- Continuous Deployment on App Engine with Gitlab CI Fail with no error
- Gitlab CI running grunt from local file system
- Gerrit Replication to gitlab failed
- Create a build file git push gitlab ci
- What branch does gitlab CI checkouts?
- Gitlab CI fails to schedule builds for new commits
One Solution collect form web for “Gitlab CI – How to trigger a build only if changes happen on particular set of files”
There’s not currently any way to trigger a build in GitLab CI conditionally based on which files have been edited.
I’ve thought about this feature myself before, and I think it could be very useful for a number of different use cases.
The closest issue I could find for this is https://gitlab.com/gitlab-org/gitlab-ce/issues/23010
Anyway, to answer your question:
You can’t really do this right now – even manually – since there’s no way to determine if a merge request has changed a file or not since CI has no concept of a merge request.
Pipelines “understanding” what Merge Requests are should be added sometime soon.