Source paths can be used to specify source code paths that will trigger a job upon modification. This is done by using a
sourcePaths keyword in your job definition as a string or array of strings. This can be useful for running workflows based on subdirectories in a monorepo.
Types of source paths
You can either specify subdirectories and/or specific files as source paths. To denote a subdirectory, leave a trailing slash (
/) at the end. The path is relative to the root of the repository.
Given a repository with the file structure depicted below:
┌── README.md ├── screwdriver.yaml ├── test/ │ └── ... ├── src/ │ ├── app/ │ │ ├── main.js │ │ ├── ... │ │ └── package.json │ └── other/ │ └── ... │ ...
jobs: main: image: node:6 requires: [~pr, ~commit] sourcePaths: ["src/app/", "screwdriver.yaml"] steps: - echo: echo hi
In this example, the job
main will be triggered if there are any changes to files under
src/app/ or the
screwdriver.yaml file (like on
src/app/package.json, etc.). The
main job will not, however, be triggered on changes to
- This feature is only available for the Github SCM right now.
sourcePathswill be ignored if you manually start a pipeline or restart a job.
screwdriver.yamlmust still be located at root.