feat: add skip_path
option in watch
#27
Open
+144
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for specifying a
skip_path
option that support either a path or a list of paths that shouldn't result in adding thetrigger
step as part of the dynamically generated pipeline.Note even in cases where a line in the
diff
is skipped due toskip_path
and there are other paths in thediff
that matchpath
but doesn't matchskip_path
, the step will still be added to the dynamically generated pipeline. i.e. for the step to be effectively ignored, the paths inskip_path
should match all of those in the givendiff
.Motivation
The motivation for this is the lack of support for negation cases in
doublestar
(the package used for glob pattern matching) See bmatcuk/doublestar#49.I had a use case where I needed to avoid changes in certain subdirectories to trigger a step (if there were the only changes in the diff) and I tried to use the following pattern:
path: "/main/{*,!(subdir1|subdir2)/**/*}"
which should be a valid glob for filtering outsubdir1
andsubdir2
, but didn't work.With this, I could instead do something like:
and the result would be the same.
This is a
git cherry-pick
from adikari#88This will close #20.