Skip to content
Latchkey

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 found

Common 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

  1. Append to GITHUB_PATH in one step, then use the tool in a following step.
  2. If you must use it immediately, prepend the directory to PATH inline for that command.
  3. 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 --version

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →