-
Notifications
You must be signed in to change notification settings - Fork 767
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 output parameters for the tool path and version #66
Conversation
__tests__/verify-java.ps1
Outdated
@@ -1,11 +1,31 @@ | |||
if (!$args.Count -or !$args[0]) | |||
{ | |||
throw "Must supply java version argument" | |||
throw "::error::Must supply java version argument" |
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.
Looks good! Thanks for submitting this PR.
The only question I have is regarding this ::error::
syntax. Is there any benefit to doing this? I haven't seen any of our other first party actions use this (I want to maintain some level of consistency). Online I can't seen to find anything either.
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.
This is https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message, as seen in @actions/core
's error()
too as an implementation detail.
Not sure about the throw
in PowerShell though, but according to https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_throw?view=powershell-7 this should work 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.
I played around this, it makes the error message show up red in the logs so it's a pretty nice addition 😃
It doesn't fail the step though so exit 1
is still needed (for bash).
If Powershell it's redundant as throw will make the logs show up red and it will fail the step so the extra ::errror::
is not needed
This allows calling the action multiple times in the same job and retrieving the path and/or version in other steps. Fixes actions#65
Force-pushed with the PowerShell changes. |
Did some extra testing and everything is 👍 Thanks for the contribution @tbroyer 🎉🎈 |
This allows calling the action multiple times in the
same job and retrieving the path and/or version in
other steps.
Fixes #65