-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Added support for dereferenced map properties #2635
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for implementing this 👍
I may cherry pick this into my new upstream, on actions-oss to release this earlier
env := &EvaluationEnvironment{} | ||
|
||
env.Needs = map[string]Needs{ | ||
"first-job": { | ||
Outputs: map[string]string{}, | ||
Result: "success", | ||
}, | ||
"second-job": { | ||
Outputs: map[string]string{}, | ||
Result: "failure", | ||
}, | ||
} |
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.
Only a code style consistency suggestion
env := &EvaluationEnvironment{} | |
env.Needs = map[string]Needs{ | |
"first-job": { | |
Outputs: map[string]string{}, | |
Result: "success", | |
}, | |
"second-job": { | |
Outputs: map[string]string{}, | |
Result: "failure", | |
}, | |
} | |
env := &EvaluationEnvironment{ | |
Needs: map[string]Needs{ | |
"first-job": { | |
Outputs: map[string]string{}, | |
Result: "success", | |
}, | |
"second-job": { | |
Outputs: map[string]string{}, | |
Result: "failure", | |
}, | |
}, | |
} |
{`contains(fromJSON('[{ "first": { "result": "success" }},{ "second": { "result": "success" }}]').first.result, 'success') }}`, true, "multiple-contains-item"}, | ||
{`contains(fromJSON('[{ "result": "success" },{ "result": "failure" }]').*.result, 'failure') }}`, true, "multiple-contains-dereferenced-failure-item"}, | ||
{`contains(fromJSON('[{ "result": "failure" },{ "result": "success" }]').*.result, 'success') }}`, true, "multiple-contains-dereferenced-success-item"}, | ||
{`contains(fromJSON('[{ "result": "failure" },{ "result": "success" }]').*.result, 'notthere') }}`, false, "multiple-contains-dereferenced-missing-item"}, | ||
} |
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.
Additional Tests for outputs used by me during review
} | |
{`contains(fromJSON('[{ "result": "failure", "outputs": { "key": "val1" } },{ "result": "success", "outputs": { "key": "val2" } }]').*.outputs.key, 'val1') }}`, true, "multiple-contains-dereferenced-output-item"}, | |
{`contains(fromJSON('[{ "result": "failure", "outputs": { "key": "val1" } },{ "result": "success", "outputs": { "key": "val2" } }]').*.outputs.key, 'val2') }}`, true, "multiple-contains-dereferenced-output-item-2"}, | |
{`contains(fromJSON('[{ "result": "failure", "outputs": { "key": "val1" } },{ "result": "success", "outputs": { "key": "val2" } }]').*.outputs.key, 'missing') }}`, false, "multiple-contains-dereferenced-output-misssing-item"}, | |
} |
Fixes #2591