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.

  • Is it possible in gitlab-ci build another branch to another directory?
  • Gitlab: Is it possible to create a merge request from MY fork to Another fork of the same project
  • Gitlab CI vs Jenkins
  • Gitlab CI fails to schedule builds for new commits
  • Only Single GitLab CI Runner Building
  • Failed Test in Gitlab
  • Gitlab CI + maven: Use another repo as local dependency
  • gitlab runner The requested URL returned error: 403
  • 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.

    Git Baby is a git and github fan, let's start git clone.