github / github/vscode-github-actions

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

Đang mở
#490 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
660
Fork
213
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.