github / github/vscode-github-actions

Yaml validation fail when using expession in job env or step env

Abierto
#490 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
660
Forks
213
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Describe the bug**
I have a workflow that uses a matrix that define env to use with each job.
Using expression to set the job env fail validation.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a workflow file like this
```
---

on:
push: {}

jobs:
myjob:
strategy:
matrix:
include:
- name: 'env1'
runs-on: 'ubuntu-22.04'
env:
VAR1: 'value1'
VAR2: 'value2'
- name: 'env2'
runs-on: 'ubuntu-24.04'
env:
VAR1: 'value3'
VAR2: 'value4'
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
env: ${{ matrix.env }}
steps:
- name: Run tests
run: 'echo "var1: $VAR1, var2: $VAR2"'
```

2. See validation error in vscode
```
`Unexpected type 'BasicExpressionToken' encountered while reading 'job env'. The type 'MappingToken' was expected.`
```

3: running the workflow produces
env1
```
Run echo "var1: $VAR1, var2: $VAR2"
var1: value1, var2: value2
```
env2
```
Run echo "var1: $VAR1, var2: $VAR2"
var1: value3, var2: value4
```
No errors.

**Expected behavior**
I would expect validation not to produce an error like this

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.