fix: install Gemini CLI into runner temp prefix
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
bindirectory to the current stepPATHand toGITHUB_PATHfor later steps. - Use
npm install --global --prefix "${GEMINI_CLI_INSTALL_PREFIX}"for npm installs. - Point
PNPM_HOMEat 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 installcompleted. Local Nodev22.11.0emitted 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-installprefix - installed
@google/gemini-cli@latestwith--global --prefix command -v geminiresolved to the temp prefixgemini --versionreturned0.45.2
- created a temp
npm run format:checkgit diff --check
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.