run-gemini-cli icon indicating copy to clipboard operation
run-gemini-cli copied to clipboard

fix: install Gemini CLI into runner temp prefix

Open beanscg opened this issue 5 months ago • 1 comments

Addresses #332.

This changes the Gemini CLI install step to use a runner-temp install prefix instead of relying on the system npm global prefix. On locked-down self-hosted runners, the default global prefix can be unwritable, which can cause the npm install --global @google/gemini-cli@latest step to fail before gemini is available on PATH.

Changes:

  • Create a temporary install prefix under ${RUNNER_TEMP:-${HOME}}/gemini-cli-install.
  • Add the install prefix bin directory to the current step PATH and to GITHUB_PATH for later steps.
  • Use npm install --global --prefix "${GEMINI_CLI_INSTALL_PREFIX}" for npm installs.
  • Point PNPM_HOME at the same bin directory for the pnpm global install path.
  • Apply the same temp-prefix behavior when installing a built Gemini CLI checkout from a branch/tag/commit.

Validation:

  • ruby -e "require 'yaml'; YAML.load_file('action.yml')"
  • npm install completed. Local Node v22.11.0 emitted an engine warning for Vite requiring ^20.19.0 || >=22.12.0, but install completed.
  • Local npm-prefix install simulation:
    • created a temp gemini-cli-install prefix
    • installed @google/gemini-cli@latest with --global --prefix
    • command -v gemini resolved to the temp prefix
    • gemini --version returned 0.45.2
  • npm run format:check
  • git diff --check

beanscg avatar Jun 08 '26 18:06 beanscg

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jun 08 '26 18:06 google-cla[bot]