Skip to content

Be able to keep full semver requirement in package.json #21

@ThomasTrepanier

Description

@ThomasTrepanier

Context

I want to enforce a specific Node version in my repository with the full semantic versioning (i.e 20.15.1).
This Action however truncates the Node version to the major number, which means that we can only enforce a major of Node locally using the engines field of the package.json

Desired behaviour

When using this workflow, I can update the engines field in my package.json to match the full version resolved by Node from the inputted version.

Example

Workflow file configuration

# workflow.yml

- uses: hongaar/update-node-versions@v2
  with:
    versions: lts
    updaters.workflows: false
    updaters.engines: true

Desired package.json Output (using LTS = 20.15.1)

"engines": {
  "node": ">=20.15.1"
}

Current package.json Output (using LTS = 20.15.1)

"engines": {
  "node": ">=20"
}

Proposition

This could be an input provided for the engines field, like updaters.engines.fullVersion or something like that. It could be used for updaters.files too, but it's not necessary for updaters.workflows as Github Action automatically pulls the latest version when specifying a major anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions