-
Notifications
You must be signed in to change notification settings - Fork 177
fix: handle more edge cases in evaluateRuleIf #1340
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
Conversation
let value = `${expandWith.variable(name)}`; | ||
if (value.startsWith("\"/") && value.endsWith("/\"")) { | ||
value = value.substring(1).slice(0, -1); | ||
} |
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.
Removed this chunk in order to support the following scenario:
job:
image: alpine
variables:
teststring: "/test/url"
pattern: /test//
script:
- echo works
rules:
- if: '$teststring =~ $pattern' # gcl works
- if: $teststring =~ /test// # gcl does not work but it's expected to work
{if: "$VAR1 && (($VAR2 =~ /ci-skip-job-/ && $VAR2 =~ $VAR3) || ($VAR2 =~ /ci-skip-stage-/ && $VAR2 =~ $VAR3))", when: "manual"}, | ||
]; | ||
variables = {VAR1: "val", VAR2: "ci-skip-job-", VAR3: "ci-skip-job-"}; | ||
variables = {VAR1: "val", VAR2: "ci-skip-job-", VAR3: "/ci-skip-job-/"}; |
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.
f98ab80
to
b3e19c2
Compare
|
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.
Lets go
@ANGkeith You want a new version now? |
sure thing. thanks |
fixes #1335
Might have made the regex now even more confusing 😅
but hopefully this will make the rules evaluation behavior closer to gitlab.com's one...