setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

node-version output without `v`

Open y-nk opened this issue 7 months ago • 1 comments

Description:

I'd like to propose that we change the format of the outputs.node-version to not include v.

Justification:

The rational is that it's very easy to add the v with v${ steps.setup-node.outputs.node-version } but it's impossible to remove it since github does not give expressions to perform operations on strings.

The most mainstream usage i see of this (and i'm probably biased) is to pass the node-version installed in CI in a docker build with something such as ARG NODE_VERSION=22; FROM node:${NODE_VERSION}-alpine where obviously the v doesn't fit. Also semver computation would benefit from this as vX.Y.Z is not a semver compliant format.

Are you willing to submit a PR?

Yes, but I'd prefer directions before:

  • Either it's made breaking and we keep node-version as a single output
  • Either it's made non-breaking by introducing another parameter and adding a warning node to deprecate the 1st one - i have no idea how to name that parameter.

y-nk avatar Jun 30 '25 03:06 y-nk

Hi @y-nk 👋, Thank you for the feature request, we will investigate it and get back to you as soon as we have some feedback.

priyagupta108 avatar Jun 30 '25 07:06 priyagupta108