Resolve mise aliases such as `lts` when reading mise.toml

Offen
#1,670 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 7 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
github-actions, node.js, typescript
Bereich
ci-cd, devops, tooling

Rechercherichtung

Start by tracing how mise.toml values flow from getNodeVersionFromFile into isLtsAlias and version resolution. Check the existing tests for mise version files and LTS aliases, then add coverage for node = "lts"; done means it resolves as the current LTS or returns a clear error for unsupported mise aliases.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

Description:

node-version-file: mise.toml (added in v7.1.0, #1421) reads [tools] node and passes the value through unchanged. Values that are valid for mise but are not in setup-node's version syntax then fail to resolve.

The common case is LTS:

# mise.toml
[tools]
node = "lts"
- uses: actions/[email protected]
  with:
    node-version-file: mise.toml

getNodeVersionFromFile returns lts. isLtsAlias only matches values that start with lts/, so lts is treated as a semver range, matches no release, and the step fails.

Proposal: when the version comes from mise.toml, translate mise's aliases to setup-node's syntax before resolving. At minimum, map lts to lts/*. Other mise-specific aliases could be handled the same way, or rejected with a clear error that names the unsupported value.

Justification:

A mise.toml is written for mise, and node = "lts" is the usual way to ask mise for the current LTS. Users who adopt the new mise.toml support expect the file they already have to work. Today the only option is to rewrite it as lts/*, which makes the file depend on setup-node's syntax instead of mise's, or to keep a separate node-version input in the workflow, which defeats the point of reading the file.

Are you willing to submit a PR?

Not at this time.

Vorherrschende Sprache
TypeScript
Sterne
5k
Forks
1.7k
Ø Merge
5 T. 1 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus actions/setup-node

Alle Issues in actions/setup-node

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.