Skip to content

ci: install keploy without writing install.sh in the checkout - #8

Merged
slayerjain merged 1 commit into
mainfrom
fix/install-oneliner-cwd
Nov 1, 2026
Merged

slayerjain merged 1 commit into
mainfrom
fix/install-oneliner-cwd

Conversation

@slayerjain

Copy link
Copy Markdown
Member

Installers: both installers already stopped touching the caller's folder: keploy/enterprise#3166 (released in v3.8.105, served at keploy.io/ent/install.sh) and keploy/keploy#5025 (merged 2026-11-01, served at keploy.io/install.sh). This PR fixes the commands themselves: their curl -O saved the installer into the working directory before any installer code ran. Nothing else has to merge first.

What was wrong

The "Install keploy enterprise" step of .github/workflows/keploy-sandbox.yml ran:

curl --silent -O -L https://keploy.io/ent/install.sh
sudo bash install.sh

curl -O saves the installer as ./install.sh in the checkout before any installer code runs. A repository that tracks its own install.sh had it overwritten. Without -f, an HTTP error saved the error page there too, and bash then ran it.

The workflow is a copy of the one keploy's MCP generates (scaffold_pipeline_workflow), which had the same lines.

What changed

The step's first line is now:

keploy_rc=0; keploy_sh="$(mktemp)" && curl -fsSL https://keploy.io/ent/install.sh -o "$keploy_sh" && sudo bash "$keploy_sh" || keploy_rc=$?; rm -f "$keploy_sh"; [ "$keploy_rc" -eq 0 ]
  • The installer goes to a temp file (mktemp, outside the checkout) and runs only once the whole file has arrived. The file is then removed.
  • The step fails when the download fails (an HTTP error, through -f, or a transfer cut off partway) or when the installer fails, so the job stops at the install step instead of going on with whatever keploy the runner has.
  • The status is kept in keploy_rc so that under GitHub Actions' bash -e a failing installer still reaches the rm.
  • It is the exact line keploy's MCP now generates for this workflow (keploy/api-server, same change). keploy --version stays on the next line.

Files touched

  • .github/workflows/keploy-sandbox.yml (2 lines replaced by 1, in the install step)

How it was checked

  • The workflow parses as YAML, and the install step's first run line equals the generated line in keploy/api-server byte for byte.
  • That line ran from the root of a temp git repo that tracks install.sh, with TMPDIR fresh, a stub installer served in place of the URL, on Linux amd64 under dash, bash 5.2 and zsh 5.9, in GitHub Actions' bash -e FILE shape and others, with bash and with sudo bash: success runs the installer (as root under sudo) and then the next line; a 404 fails the step with and without sudo, and so do a failing installer and a response cut off partway; after a failure the next line does not run. git status stays empty and TMPDIR ends empty.

Stated limits

  • The step sets two shell variables, keploy_rc and keploy_sh.
  • The workflow runs on ubuntu-latest, where keploy lands in /usr/local/bin. On a macOS runner the installer puts it in ~/.keploy/bin, which the step does not add to PATH.

Same fix elsewhere

The same command is being replaced, one PR per repo, in keploy/keploy, keploy/enterprise, keploy/api-server, keploy/enterprise-ui, keploy/vscode-extension-enterprise, keploy/vscode-extension, keploy/docs, keploy/landing, keploy/homebrew-tap, keploy/orderflow, keploy/bruno, and the READMEs of keploy/samples-go, samples-python, samples-typescript, samples-csharp, samples-java and samples-rust. keploy/website and the JetBrains plugin also show the old command, but they are not live, so they were skipped.

The sandbox workflow's install step saved the installer as ./install.sh
in the checkout with `curl --silent -O -L` and then ran it. A repository
that tracks its own install.sh had it overwritten before any installer
code ran, and without -f a failed download saved an error page there.

The step now saves the installer to a temp file outside the checkout,
runs it only once the whole file has arrived, removes it, and fails the
step when the download (an HTTP error or a transfer cut off partway) or
the installer fails. It is the line keploy's MCP now generates for this
workflow.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain merged commit 7add18a into main Nov 1, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant