Skip to content

fix(action): detect existing Node ≥18 before calling setup-node#2

Merged
caballeto merged 1 commit into
mainfrom
fix/node-detection-guard
May 5, 2026
Merged

fix(action): detect existing Node ≥18 before calling setup-node#2
caballeto merged 1 commit into
mainfrom
fix/node-detection-guard

Conversation

@caballeto
Copy link
Copy Markdown
Member

Summary

The action's default node-version: '20' silently downgraded callers who already had Node 22+ set up by an earlier actions/setup-node call.

Now: detect existing Node first; only install if missing or <18. The node-version input is the version we install IF that fallback path runs.

Round-2 DevEx friction P1 #5 (see /tmp/devex-r2-setup-devhelm/REPORT.md).

Test plan

  • YAML syntax valid (yq eval . action.yml)
  • After release, retest in a workflow that pre-installs Node 22 and verify it stays 22

Made with Cursor

Previously the action's default node-version: '20' caused
actions/setup-node@v4 to silently downgrade callers who had pinned
Node 22+ via an earlier setup-node step.

Add a Detect existing Node.js step that checks `node` on PATH and its
major version. When Node ≥18 is already present we skip the inner
setup-node entirely; otherwise we still install the configured
node-version (default 20) as a fallback. Reword the input description
and update the README to document the new behavior.

Round-2 DevEx friction P1 — see /tmp/devex-r2-setup-devhelm/REPORT.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit b81da91 into main May 5, 2026
7 checks passed
@caballeto caballeto deleted the fix/node-detection-guard branch May 5, 2026 20:54
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