Failing Set-ActionOutput when value is multi-line
amis92 opened this issue · 2 comments
amis92 commented
Setting output fails when using environment files and passing a multi-line value.
https://github.com/Amadevus/pwsh-script/actions/runs/3276636531/jobs/5392922719#step:11:13
Error: Unable to process file command 'output' successfully.
Error: Invalid format ' new line '
amis92 commented
Turns out, the implementation incorrectly decides to use key=value
format. When newline in value is detected, it should instead use the key<<delimiterLFvalueLFdelimiter
format.
However, the PowerShell implementation of ConvertTo-ActionKeyValueFileCommand
makes an incorrect comparison to find whether value has newlines: ($convertedValue -contains "
n")will return true only if value *is* a single newline, because
-contains` is a collection operator, not a string operator.
amis92 commented
Bug is in version 2.0.2 of this action.