SanjulaGanepola / github-local-actions

✨ Run your GitHub Actions locally in VS Code!
https://marketplace.visualstudio.com/items?itemName=SanjulaGanepola.github-local-actions
Apache License 2.0
70 stars 2 forks source link

"Cannot bind parameter 'Option'" When running workflow #78

Open staffanhedstrom opened 9 hours ago

staffanhedstrom commented 9 hours ago

Hello!

This extension looked intriguing but I cannot get it to run. Act and Docker engine both show green. image

But any workflow I try to run produces this error:

 *  Executing task: set -o pipefail; act --workflows ".github/workflows/myworkflow.yml" --job "tests" --secret-file "" --var-file "" --input-file "" --eventpath "" 2>&1 | tee "c:\Users\myuser\AppData\Roaming\Code\User\globalStorage\sanjulaganepola.github-local-actions\MyTest #1 - 20241125_145859.log" 

Set-Variable : Cannot bind parameter 'Option'. Cannot convert value "pipefail" to type "System.Management.Automation.ScopedItemOptions". Error: "Unable to match the identifier name pipefail to a valid enumer
ator name. Specify one of the following enumerator names and try again:
None, ReadOnly, Constant, Private, AllScope, Unspecified"
At line:1 char:8
+ set -o pipefail; act --workflows .github/workflows/development_landei ...
+        ~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-Variable], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.SetVariableCommand

Tee-Object : A positional parameter cannot be found that accepts argument 'and'.
At line:1 char:159
+ ... ath  2>&1 | tee c:\Users\myuser\AppData\Roaming\Code\User\globa ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Tee-Object], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.TeeObjectCommand

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command set -o pipefail; act --workflows ".github/workflows/myworkflow.yml" --job "tests" --secret-file "" --var-file "" --input-file "" --eventpath "" 2>&1 | tee "c:\Users\myuser\AppData\Roaming\Code\User\globalStorage\sanjulaganepola.github-local-actions\MyTest #1 - 20241125_145859.log"" terminated with exit code: 1. 

VS Code is run as admin.

ChristopherHX commented 7 hours ago

As far I can tell, the problem is this extension uses shellexecute with a bash script containing pipefail and the act command.

So windows seems to be broken via powershell as default shell

Linux and macOS should work at the moment.

I'm a nektos/act maintainer

ChristopherHX commented 3 hours ago

Made a pr for basic windows support

image

Log preservation and spaces in filenames are not supported, but something to play with