A Path Filtering Task only executes subsequent tasks if the commit(s) that triggered the build contained files matching certain paths. These paths are provided in the form of ant globs, a simple way for matching paths.

For example, you may have a slow multi-module maven build. If all the files changed are in a single module, perhaps you wish to only build and run the tests for that module. Similarly, if only .mdfiles have changed, perhaps you want to only rebuild your documentation.

To create a path filtering task, follow these steps:

  1. Enter the path for the ant globs in Paths.

  2. Enter file matches in Match Type.

    If the script returns true, or a truthy value, the subsequent tasks are executed. If not, they are skipped.

  3. Enter how many tasks execute if the condition is true in Execute Tasks.

  4. Check the Ignore Non-Code Changes if the task is a code change.