bash "command not found" (PATH) in CI
bash looked through each directory in $PATH and found no matching executable, so it exited 127. Either the tool was never installed on the runner, or it installed somewhere that is not on PATH for this step.
What this error means
A step fails with "line N: <tool>: command not found" and the job ends with "exit code 127". Common with tools installed in a previous step whose PATH change did not persist.
/home/runner/work/_temp/script.sh: line 1: terraform: command not found
Error: Process completed with exit code 127.Common causes
The tool is not installed on the runner
The binary was never provisioned in this image, or a setup action that installs it was skipped or failed earlier in the job.
The install directory is not on PATH
A tool installed into ~/.local/bin or a custom path is invisible because each GitHub Actions step is a fresh shell; a bare export PATH=... in one step does not carry to the next.
How to fix it
Add the directory to PATH durably
In GitHub Actions, append to $GITHUB_PATH so the change persists into later steps, rather than exporting PATH inline.
- run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"Install the tool in the same job
- Add a setup step (a setup-* action or a package install) before the step that uses the tool.
- Confirm the install location with
command -v <tool>andecho "$PATH". - Reference the binary by absolute path if it lives outside PATH.
command -v terraform || echo "not on PATH: $PATH"How to prevent it
- Use
$GITHUB_PATHfor PATH changes that must survive across steps. - Verify installs with
command -vright after installing. - Pin setup actions that place binaries on PATH for you.