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
{{ message }}
Repository navigation
shell in step/defaults cannot use job/matrix templates #444
The workflow is not valid. .github/workflows/bug1.yml (Line: 9, Col: 17): Unrecognized named-value: 'job'. Located at position 1 within expression: job.status
As far as I can tell this is due to non-empty-string being used instead of string-steps-context (or perhaps new non-empty-string-steps-context?) here:
Reacted by Vitaly Potyarkin, Jukka Palomäki, Eligio Mariño, Jin Lei, Petar Kirov, Martin Prüsse, ellie 🌸, Oliver Lipkau, FlooferLand!, Andrey Filipenkov and 4 more
While reproducing this issue, I noticed that shell expression would work now. Could you please tell me if you are still experiencing this issue? If you do, could you provide an example repository so I can reproduce this behaviour with your workflow, so I don't miss anything?
Another example where expressions could be useful in shell:
I tried to use custom shell with GitHub actions, and installed in previous step. But I can not reference the absolute path with: shell: ${{ github.workspace }}/bin/shell {0} because:
The workflow is not valid. .github/workflows/test.yml (Line: 77, Col: 16): Unrecognized named-value: 'github'
I'm facing this issue as well. I'm trying to run custom shells so I can test my application with a tty. This is different on different OSes, so I want to use the matrix like this:
jobs:
test:
...test-jvm-compatibility:
needs: teststrategy:
fail-fast: falsematrix:
os: [macos-latest, windows-latest, ubuntu-latest]java-version: [17, 21, 25]include:
- os: macos-latestshell-with-pty: 'script -q /dev/null bash -c "bash {0}"'
- os: ubuntu-latestshell-with-pty: 'script -q -e -c "bash {0}"'
- os: windows-latestshell-with-pty: 'winpty -Xallow-non-tty bash {0}'runs-on: ${{ matrix.os }}steps:
- uses: actions/setup-java@v5with:
distribution: 'temurin'java-version: ${{ matrix.java-version }}
- name: Download R8 Jaruses: actions/download-artifact@v6with:
name: main-r8-jarpath: artifacts
- name: Run R8 Jar without a tty without enable-native-access all-unnamedrun: java -jar artifacts/main-r8.jar
- name: Run R8 Jar without a tty with enable-native-access all-unnamedrun: java --enable-native-access=ALL-UNNAMED -jar artifacts/main-r8.jar
- name: Run R8 Jar with a tty without enable-native-access all-unnamedshell: ${{ matrix.shell-with-pty }}run: java -jar artifacts/main-r8.jar
- name: Run R8 Jar with a tty with enable-native-access all-unnamedshell: ${{ matrix.shell-with-pty }}run: java --enable-native-access=ALL-UNNAMED -jar artifacts/main-r8.jar
But I'm getting this like everyone else:
Invalid workflow file
(Line: 105, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell-with-pty, (Line: 109, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell-with-pty
Is there any chance we could see this implemented soon?
Activity
TingluoHuang commentedon Apr 22, 2020
Shell is mean to set to ‘cmd’ ‘bash’ ‘sh’ and ‘powershell’
We do support expressions in the script content
Shell: bash
jacekkow commentedon Apr 22, 2020
Per docs:
https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
So I'm defining custom shell and its options (as documented). I really don't see a reason for "run" accepting expressions and "shell" not.
TingluoHuang commentedon Apr 22, 2020
@chrispat for whether we allow expression in script's
shelloptionchrispat commentedon Apr 22, 2020
I don't see any reason not to. The only reason we don't allow it is
usesis so we can implement policy to prevent running certain actions.JustinGrote commentedon Mar 26, 2021
@chrispat any update? I want to run Powershell test/builds in matrix and right now I have two very redundant tasks with an if expression gating them.
nikola-jokic commentedon Feb 8, 2022
Hi @JustinGrote,
While reproducing this issue, I noticed that shell expression would work now. Could you please tell me if you are still experiencing this issue? If you do, could you provide an example repository so I can reproduce this behaviour with your workflow, so I don't miss anything?
5 remaining items
sio commentedon Jul 20, 2022
Another example where expressions could be useful in
shell:I tried to use custom shell with GitHub actions, and installed in previous step. But I can not reference the absolute path with:
shell: ${{ github.workspace }}/bin/shell {0}because:Refactor Cygwin configuration for GitHub Actions
msJinLei commentedon Jul 17, 2024
I modifiy the example workflow https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-expanding-configurations
into the following one.
It reports the same error as above.
variables in shell: does not work
actions/runner#444 - i fucking hate github actions
jeremyd2019 commentedon Jun 19, 2025
The https://github.com/cygwin/cygwin-install-action action has an output for the install path, so I reasonably tried to do
I think this is this same 5-year-old bug?!?
"shell" in steps cannot use expressions (actions/runner#444)
fix(#437,#439,#440): restore defaults.run.shell + 'zsh {0}' format + …
Fix CI: shell key does not accept matrix expressions
Name the PowerShell hosts literally, since shell accepts no expression
joffrey-bion commentedon Aug 10, 2026
I'm facing this issue as well. I'm trying to run custom shells so I can test my application with a tty. This is different on different OSes, so I want to use the matrix like this:
But I'm getting this like everyone else:
Is there any chance we could see this implemented soon?
fix(release): repair the workflow file that GitHub could not validate
ci: adicionar job Pester em Windows PowerShell 5.1 (fecha UF2)
docs(findings): fechar UF2 com prova real (WinPS 5.1 no CI), descarta…
S0-T08 fix: workflow CI не запускался, shell: matrix недоступен