Skip to content

fix: spawn pnpm without a shell to silence Node DEP0190 deprecation w… - #52

Open
sebdanielsson wants to merge 1 commit into
pnpm:mainfrom
sebdanielsson:copilot/fix-deprecation-warning
Open

fix: spawn pnpm without a shell to silence Node DEP0190 deprecation w…#52
sebdanielsson wants to merge 1 commit into
pnpm:mainfrom
sebdanielsson:copilot/fix-deprecation-warning

Conversation

@sebdanielsson

@sebdanielsson sebdanielsson commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #18

Every run of the action logged (node) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true because two call sites spawned pnpm with an args array and shell: true. All args are fixed literals, so the shell added no value — it only existed to resolve the pnpm.cmd batch file on Windows.

Changes

  • src/pnpm-install/index.ts — dropped shell: true from the pnpm install spawn
  • src/pnpm-store-prune/index.ts — dropped shell: true from the pnpm store prune spawn
  • dist/index.js — rebuilt bundle

The executable name is now resolved by platform instead, matching how install-runtime already spawns pnpm shell-free:

const pnpmBin = process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm'
spawnSync(pnpmBin, args, { stdio: 'inherit', cwd: workingDirectory })

Windows needs the explicit .cmd name because a CMD batch file cannot be spawned without a shell; on POSIX, bare pnpm resolves through PATH, which install-pnpm has already pointed at the pnpm this action installed.

Summary by CodeRabbit

  • Bug Fixes
    • Destination paths are now consistently converted to absolute paths, improving reliability when installing pnpm.
    • Installation and store-pruning operations now use the pnpm executable installed for the action, reducing reliance on system configuration.
    • pnpm commands no longer depend on shell-based execution, helping ensure more predictable behavior across supported platforms.

…arning

pnpm install and pnpm store prune were spawned with an args array and
`shell: true`, which makes Node emit a DEP0190 deprecation warning
("Passing args to a child process with shell option true can lead to
security vulnerabilities") on every run.

Spawn the pnpm this action installed by its absolute path instead —
path.join(dest, 'pnpm.exe' | 'pnpm'). Running the .exe directly on Windows
runs the actual binary rather than the .cmd batch file, which needs no
shell, so the warning is gone on every platform. `dest` is normalized to
an absolute path in getInputs so the spawned path is not affected by the
`cwd` the install runs with.

Co-authored-by: sebdanielsson <20663065+sebdanielsson@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 20:52
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: c5161b3c-763d-4751-84f4-2154570d0b4a

📥 Commits

Reviewing files that changed from the base of the PR and between 703c526 and 8dd17f0.

⛔ Files ignored due to path filters (1)
  • dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (3)
  • src/inputs/index.ts
  • src/pnpm-install/index.ts
  • src/pnpm-store-prune/index.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🔇 Additional comments (3)
src/inputs/index.ts (1)

129-129: LGTM!

src/pnpm-install/index.ts (1)

51-53: LGTM!

src/pnpm-store-prune/index.ts (1)

3-3: LGTM!

Also applies to: 13-14


📝 Walkthrough

Walkthrough

The action now resolves dest to an absolute path. Pnpm install and store-prune operations invoke the platform-specific pnpm executable from that path without using shell-based PATH resolution.

Changes

Direct pnpm execution

Layer / File(s) Summary
Destination path resolution
src/inputs/index.ts
The dest input expands tilde notation and resolves to an absolute path.
Platform-specific executable invocation
src/pnpm-install/index.ts, src/pnpm-store-prune/index.ts
Both operations invoke pnpm from inputs.dest, using pnpm.exe on Windows and pnpm elsewhere. Shell execution is removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8dd17

The action now runs the installed pnpm executable from an absolute destination path, avoiding shell spawning and the associated deprecation warning. No current merge-blocking risk is identified.

Suggested reviewers: zkochan

Poem

A rabbit found a path made bright
With absolute steps in moonlit light
Pnpm hopped from its own front door
No shell was needed anymore
Windows ears heard .exe right

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: spawning pnpm without a shell to avoid the Node DEP0190 deprecation warning.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are small, consistent across call sites, and correctly avoid shell: true by executing the installed pnpm binary via a stable absolute path.

Pull request overview

This pull request removes shell: true from pnpm invocations (addressing Node’s DEP0190 warning) by executing the pnpm binary via an absolute path derived from the action’s configured dest directory.

Changes:

  • Spawn pnpm via path.join(inputs.dest, 'pnpm(.exe)') instead of relying on shell: true + PATH resolution.
  • Normalize dest to an absolute path in getInputs() so spawning remains correct regardless of cwd.
  • Apply the same approach to both pnpm install and pnpm store prune.
File summaries
File Description
src/pnpm-store-prune/index.ts Runs pnpm store prune by absolute executable path and drops shell: true.
src/pnpm-install/index.ts Runs pnpm install by absolute executable path and drops shell: true.
src/inputs/index.ts Resolves dest to an absolute path to keep spawned executable paths stable.
Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking command-selection inconsistency for workflows that self-update pnpm before post-job cache pruning.

Direct spawning is valid for the installed platform binaries and fixed arguments, but post-job pruning now bypasses the PATH precedence deliberately established for a self-updated pnpm.

Files Needing Attention: src/pnpm-store-prune/index.ts

Reviews (1): Last reviewed commit: "fix: spawn pnpm without a shell to silen..." | Re-trigger Greptile

Comment on lines +13 to +14
const pnpmBin = path.join(inputs.dest, process.platform === 'win32' ? 'pnpm.exe' : 'pnpm')
const { error, status } = spawnSync(pnpmBin, ['store', 'prune'], {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Pruning bypasses updated pnpm

If a later workflow step runs pnpm self-update, the replacement in dest/bin takes precedence on PATH. This absolute path instead runs the original dest/pnpm during the post action, so cache cleanup may use different store-pruning behavior than the pnpm version used by the rest of the job. Preserve the prepared dest/bin precedence without reintroducing shell execution.

Knowledge Base Used:

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

pnpm/setup prints deprecation warnings with Node.js 24 on GitHub actions

3 participants