Can't execute multiline commands
With GitHub actions, one can execute multiple commands with this multiline syntax:
run: |
command1 --option1
command2 --option2
Such behavior, however, doesn't seem to be respected by Cypress GH action. For instance, if I have this setup:
- uses: cypress-io/github-action@v2
with:
build: |
command1 --option1
command2 --option2
The actual command executed will be a combined, invalid, command1 --option1 command2 --option2.
I ran into a similar problem with the build parameter.
It's caused by the execCommand() function here. I don't understand why but the Cypress action doesn't just pass the string as-is to the shell, it parses the build string using argument-vector (which basically just splits it on whitespace), checks that the first segment of the string (in your example command) resolves to a known binary on the $PATH using which and then glues the string components back together (which is why your command ends up as one long string).
In my case my build failed using build: ./bin/build because which ./bin/build fails 🙄
I would be open to a pull request implementing this