You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that apparently GHA does not allow you use shell: ${{ matrix.shell }}, giving an unexpected error
The workflow is not valid. .github/workflows/ci.yaml (Line: 77, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell .github/workflows/ci.yaml (Line: 124, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell
The error above makes me think that GHA is not really able to use dynamic expressions on shell:, while it is able to do the same thing on if:, name: or run:.
It would be very useful to have an example where something like this works cross-platforms, especially as in real life the number of steps is considerably bigger and duplicating each "run" and adding conditions makes the workflow files reach an unmaintainable size. Even splitting them into two and using different jobs for windows and non windows does create similar maintenance challenges.
In case someone else gets into the same issue, I found a solution, using defaults with fallback values can help you switch the default shell. Look at ansible/team-devtools#29 (comment)
Repository owner
locked and limited conversation to collaborators
Feb 7, 2022
When doing matrix testing on multiple platforms one may want to test on a matrix like below:
The problem is that apparently GHA does not allow you use
shell: ${{ matrix.shell }}
, giving an unexpected errorThe error above makes me think that GHA is not really able to use dynamic expressions on
shell:
, while it is able to do the same thing onif:
,name:
orrun:
.It would be very useful to have an example where something like this works cross-platforms, especially as in real life the number of steps is considerably bigger and duplicating each "run" and adding conditions makes the workflow files reach an unmaintainable size. Even splitting them into two and using different jobs for windows and non windows does create similar maintenance challenges.
Also posted at https://github.uint.cloudmunity/t/unable-to-use-expressions-as-argument-to-shell/226230
The text was updated successfully, but these errors were encountered: