New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to trigger the deployment on changes of the specified paths #1250
Conversation
Code coverage for golang is
|
for _, change := range changes { | ||
matcher, err := filematcher.NewPatternMatcher([]string{change}) | ||
if err != nil { | ||
return false, err | ||
} | ||
if matcher.MatchesAny(changedFiles) { | ||
return true, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I'm dumb but is it needed to perform for loop? We just give all patterns to it, right?
matcher, err := filematcher.NewPatternMatcher([]string{changes})
if err != nil {
return false, err
}
if matcher.MatchesAny(changedFiles) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can give all patterns to filematcher
and parse all of them before checking.
But by doing one by one we can have fast-return and reduce the number of unneeded regex parsing.
(In the future we can enable the regex cache too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense! Okay, let's keep it as is.
Code coverage for golang is
|
Co-authored-by: Ryo Nakao <ryo@nakao.dev>
Code coverage for golang is
|
/lgtm |
Thanks 🚀 |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #979
Does this PR introduce a user-facing change?: