Draft
Conversation
2 tasks
TimmyTie2
approved these changes
Jun 25, 2021
Author
|
unfortunately, it turns out this doesn't work, because of the runner: https://github.com/actions/runner/blob/be9632302ceef50bfb36ea998cea9c94c75e5d4d/src/Runner.Worker/ActionRunner.cs#L189-L202 // Merge the default inputs from the definition
if (definition.Data?.Inputs != null)
{
var manifestManager = HostContext.GetService<IActionManifestManager>();
foreach (var input in definition.Data.Inputs)
{
string key = input.Key.AssertString("action input name").Value;
validInputs.Add(key);
if (!inputs.ContainsKey(key))
{
inputs[key] = manifestManager.EvaluateDefaultInput(ExecutionContext, key, input.Value);
}
}
}I will try investigate further if it's possible to achieve this in a different way. |
Author
|
Acknowledged as a bug in actions/runner#924. I'll PR a fix for that and then bring this back. Edit: #1176 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am trying to determine if an input has been provided in an action where an empty string is a valid value, unfortunately an empty string is treated the same as no input by
getInput. I would ideally like to changegetInputto distinguish between "no value" and "empty value" but that would be a breaking change: the introduction ofhasInputis a safe middle-ground that enables this determination without any breaking changes.An alternative I considered was introducing a
defaulttoInputOptionswhich would help bringInputOptionsandaction.ymlin line but I think that introduces more questions (shouldtrimWhitespacebe an option inaction.yml?) so I went for the simpler option.