Agent-job engine-install "Setup Node.js" step ignores `runtimes.node.version`

Aperta Adatta ai principianti
#76,559 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, go
Ambito
ci-cd, devtools

Direzione di ricerca

Leggi pkg/workflow/nodejs.go e segui generateNodeJsSetupStep(data) insieme a resolveNodeSetupActionOverride(data) per capire come le impostazioni del runtime arrivano al passaggio di configurazione generato. Controlla come sono rappresentati i valori importati di runtimes.node.version, quindi esegui i test pertinenti del workflow oppure aggiungi un caso mirato. Il lavoro è completato quando il passaggio di installazione del motore del job dell’agente usa la versione fissata, anche in presenza di una versione fissata importata, invece di quella predefinita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

ai-inspected

Summary

When a workflow pins runtimes.node.version, the agent job still gets a second Setup Node.js step that uses the compiler default node-version: '24'. That step comes right before Install AWF binary / the engine CLI install, so it runs after the pinned runtime setup step and overrides it on PATH. The agent and the engine CLI therefore run on whatever 24.x the runner resolves, not on the pinned version.

This is the same class of bug as #65939 (threat-detection job), which ADR 66040 fixed only for the detection / evals jobs.

Repro

Frontmatter:

engine:
  id: claude
runtimes:
  node:
    version: "24.22.1"

Compiled with gh-aw v0.93.2, the agent job contains:

      - name: Setup Node.js            # runtime setup step, honors the pin
        uses: actions/setup-node@... # v7.1.0
        with:
          node-version: '24.22.1'
      ...
      - name: Setup Node.js            # engine install step, ignores the pin
        uses: actions/setup-node@... # v7.1.0
        with:
          node-version: '24'
          package-manager-cache: false
      - name: Install AWF binary
      - name: Install Claude Code CLI

The detection job correctly emits '24.22.1'.

Cause

pkg/workflow/nodejs.go, generateNodeJsSetupStep hardcodes constants.DefaultNodeVersion:

fmt.Sprintf("          node-version: '%s'", constants.DefaultNodeVersion),

It already honors runtimes.node.action-repo / action-version through resolveNodeSetupActionOverride(data), but not version. This is still the case on main as of 2026-11-10 (also present in v1.2.2).

Expected

When runtimes.node.version is set (including through imports), generateNodeJsSetupStep(data) should emit that version. Alternatively, it should skip the redundant setup-node step when the runtime setup step has already installed Node in the same job.

Impact

Anyone who pins Node for a security fix ends up with the engine and agent running on an unpinned Node. The only workaround is to hand-patch the .lock.yml after every gh aw compile.

Lingua principale
Go
Stelle
5.6k
Fork
615
Merge medio
5h 21m
PR unite (30g)
792

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/gh-aw

Tutte le issue di github/gh-aw

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.