GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Expose the resolved Node.js and package manager versions as outputs · Issue #198 · voidzero-dev/setup-vp

Expose the resolved Node.js and package manager versions as outputs #198

New issue
Copy link
New issue
Copy link
Closed
#199
Closed
Expose the resolved Node.js and package manager versions as outputs#198
#199
Copy link
Assignees
everton-dgn

Description

@everton-dgn
everton-dgn
opened on Oct 12, 2026
Issue body actions

setup-vp only sets the version and cache-hit outputs. After the step runs, the workflow can't tell which Node.js version or which package manager version it ended up with, even though setup-vp (or vp itself, when node-version is omitted) just picked them.

- id: vp
  uses: voidzero-dev/[email protected]
- run: echo "node=${{ steps.vp.outputs.node-version }}" # always empty

I need these values for cache keys outside the dependency cache, like node_modules/.vitest-cache and .tsbuild, which should be invalidated when the runtime changes. Right now I read them back from package.json before calling the action:

- id: toolchain
  shell: bash
  run: |
    echo "node=$(jq -er '.devEngines.runtime.version' package.json)" >> "$GITHUB_OUTPUT"
    echo "bun=$(jq -er '.packageManager | capture("^bun@(?<v>[^+]+)").v' package.json)" >> "$GITHUB_OUTPUT"
- uses: voidzero-dev/[email protected]
  with:
    node-version: ${{ steps.toolchain.outputs.node }}

That only works because both versions in my package.json are exact. With a range, or with node-version left out so Vite+ resolves it (#128, #130), the value I compute and the one that got installed can differ. The matrix example in the README has the same gap: matrix.node-version is "22", not the patch release that was installed.

actions/setup-node has a node-version output and oven-sh/setup-bun has bun-version, so anyone moving from those to setup-vp loses this.

What I have in mind:

Output Example
node-version 24.20.0
package-manager bun
package-manager-version 1.4.2

vp env current --json already reports all three. Locally, with vp 1.0.0-rc.0 in a project that declares devEngines.runtime and "packageManager": "[email protected]", it prints this (paths removed):

{
  "node": { "version": "24.20.0", "source": "devEngines.runtime", "installed": true, "mode": "managed" },
  "package_manager": { "name": "bun", "version": "1.4.2", "source": "packageManager", "installed": true, "mode": "managed" }
}

So in runMain, after vp env use and the package-manager commands, the action could run vp env current --json with cwd: projectDir and set the outputs from node.version, package_manager.name and package_manager.version. If the command fails or a field is missing, fall back to unknown the way version does in printViteVersion.

From reading resolve_version in vite-plus (crates/vp_global_cli/src/commands/env/config.rs), the vp env use override is checked first (VP_NODE_VERSION, then the session file), and ranges or aliases from project files come back as exact versions. So the output should match what vp env use installed. I haven't checked that on a runner yet; if it turns out not to, node --version through the shim would do for Node.

The JSON layout changed in Vite+ 0.3.1 (voidzero-dev/vite-plus#2398): before that, the Node version was a top-level version field. Gating on supportsScopedEnv, like the package-manager input does, seems simpler than parsing both layouts.

With node-manager: false, reading current.rs it looks like vp env current reports the Node.js found on PATH, which is the right value for node-version in that case too.

Two questions before I write it:

  1. GitLab and Azure. The parity table in rfcs/azure-pipelines-integration.md lists "Version/cache-hit outputs", so I'd add the new values to .setup-vp-outputs.env and the Azure job variables as well. SETUP_VP_NODE_VERSION is already a GitLab input, though, so the output needs another name. Would SETUP_VP_INSTALLED_NODE_VERSION (next to SETUP_VP_INSTALLED_VERSION), SETUP_VP_PACKAGE_MANAGER_NAME and SETUP_VP_PACKAGE_MANAGER_VERSION work?
  2. Output names on GitHub. node-version matches setup-node and doesn't clash, since inputs and outputs live in separate namespaces. Fine with you, or would you prefer resolved-node-version?

I'm happy to send a PR covering all three integrations, with the rebuilt dist/ bundles and tests next to the changed sources.

This is unrelated to #126: that cache is keyed on the run id and doesn't need runtime versions.

Reacted by MK (fengmk2)

Activity

  1. fengmk2 commented on Oct 13, 2026

    @fengmk2
    fengmk2
    on Oct 13, 2026
    Member
    More actions

    PR is welcome!

  2. fengmk2
    assigned
    everton-dgn
    on Oct 13, 2026
  3. fengmk2
    added a commit that references this issue on Oct 15, 2026

    feat: add Node.js and package manager version outputs (#199)

    This issue will close once commit d2bd646 is merged into the 'main' branch.
    d2bd646
  4. fengmk2
    closed this as completedin #199on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @everton-dgn
    everton-dgn

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.