Bash syntax used under a POSIX sh shell
What this failure means
A CI workflow or script selects sh but uses Bash-only syntax such as [[ ... ]], source, heredoc strings, functions, or set -o pipefail.
Diagnosis
The command is likely to run under POSIX sh while using syntax that requires Bash. This causes CI-only failures on runners where /bin/sh is not Bash.
Fix steps
- Change the workflow step to
shell: bashor update the script shebang to Bash. - If Bash is not required, rewrite the command using POSIX-compatible syntax.
- Keep the selected shell and script syntax aligned in CI and local runs.
Validation
- Run
faultline inspect .from the repository root and confirm this source finding is absent or intentionally mitigated. - Run the script with the configured shell and confirm it exits successfully.
Why it matters
Shell dialect mismatches are portable until they are not: they often pass on one machine and fail on CI images where /bin/sh points to dash or another minimal shell.
Try it locally
make test
rg -n 'shell: sh|#!/bin/sh' .github/workflows scripts
make test
sh -n scripts/*.sh
How Faultline detects it
Use faultline explain shell-dialect-mismatch to see the full playbook.
faultline analyze build.log
faultline explain shell-dialect-mismatch
Generated from playbooks/bundled/source/shell-dialect-mismatch.yaml. Do not edit directly.
Try it on your own failed log
$ faultline analyze failed.log
Want this across every CI run?
Faultline Teams tracks recurring failures across all your repos and surfaces patterns in a shared dashboard.