GitHub Actions GITHUB_PATH append not taking effect
Writing to GITHUB_PATH updates PATH for subsequent steps only, not the step doing the write. Calling the tool in the same step still fails with command not found.
What this error means
A step appends a directory to GITHUB_PATH and then invokes a tool from that directory in the same step, which fails.
github-actions
+ echo "/opt/tools/bin" >> "${GITHUB_PATH}"
+ mytool --version
/usr/bin/bash: line 3: mytool: command not foundCommon causes
Using the tool in the same step as the append
GITHUB_PATH entries are merged into PATH between steps; the current step keeps its original PATH.
How to fix it
Split into two steps or set PATH inline
- Append to GITHUB_PATH in one step, then use the tool in a following step.
- If you must use it immediately, prepend the directory to PATH inline for that command.
- Re-run.
.github/workflows/ci.yml
- run: echo "/opt/tools/bin" >> "${GITHUB_PATH}"
- run: mytool --version
# or inline in a single step:
- run: PATH="/opt/tools/bin:${PATH}" mytool --versionHow to prevent it
- Append to GITHUB_PATH in an install step and use the tool in later steps.
- For same-step use, set PATH inline rather than relying on GITHUB_PATH.
Related guides
GitHub Actions "add-path command is deprecated and disabled"Fix the GitHub Actions error where the legacy "::add-path::" workflow command no longer updates PATH and must…
GitHub Actions "/usr/bin/bash: line N: command not found"Fix the GitHub Actions run-step error "/usr/bin/bash: line N: command not found" - the tool is not installed…
GitHub Actions "set-env command is disabled for security"Fix the GitHub Actions error where the legacy "::set-env::" workflow command is disabled for security and mus…