-
-
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
fix: update reusable workflow input handling #2349
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2349 +/- ##
===========================================
+ Coverage 61.56% 76.30% +14.73%
===========================================
Files 53 61 +8
Lines 9002 7806 -1196
===========================================
+ Hits 5542 5956 +414
+ Misses 3020 1295 -1725
- Partials 440 555 +115 ☔ View full report in Codecov by Sentry. |
|
||
- name: test required number | ||
run: | | ||
echo inputs.number_required=${{ inputs.number_required }} | ||
[[ "${{ inputs.number_required == 1 }}" = "true" ]] || exit 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.
tojson force string equal, to avoid any possible automatic type conversion
// evaluate using the calling RunContext (outside) | ||
value = rc.caller.runContext.ExprEval.Interpolate(ctx, str) | ||
_ = rc.caller.runContext.ExprEval.EvaluateYamlNode(ctx, &node) |
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.
expressions can return boolean and number types for parameters so EvaluateYamlNode can do it better than the typeless Interpolate
Type string `yaml:"type"` | ||
Description string `yaml:"description"` | ||
Required bool `yaml:"required"` | ||
Default yaml.Node `yaml:"default"` |
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.
preserve the original type
Remember My outstanding task here is writing testsDoneFixes #2344