github / github/vscode-github-actions
Error thrown in consuming workflows regarding JSON output values quotes
- 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**
Quotes in a reusable workflow's JSON output value is triggering an error in consuming workflows.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a reusable workflow with input and outputs, one of the output being this JSON value:
```yaml
outputs:
images:
value: '{"gcp": "${{ contains(inputs.registries, ''gcp'') && jobs.setup.outputs.gcp_image || '''' }}", "ecr": "${{ contains(inputs.registries, ''ecr'') && jobs.setup.outputs.ecr_image || '''' }}"}'
```
2. Use the first workflow in another workflow:
```yaml
build:
uses: acme/actions/.github/workflows/build.yaml@v1
```
3. See the following errors in the 2nd workflow file, but __at the line number__ from the 1st workflow file:
```
Unexpected symbol: 'gcp'''. Located at position 31 within expression: contains(inputs.registries, ''gcp'') && jobs.setup.outputs.gcp_image || '''' [Ln 72, Col 26]
Unexpected symbol: 'ecr'''. Located at position 31 within expression: contains(inputs.registries, ''ecr'') && jobs.setup.outputs.ecr_image || '''' [Ln 72, Col 120]
```
**Expected behavior**
The 1st workflow does not throw any errors when being run in Github Actions runners, so I'd expect no errors to be printed by this extension.
**Extension Version**
`v0.27.1`
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với reusable workflow và consuming workflow được nêu trong issue, sử dụng phiên bản extension đã được báo cáo làm mốc ban đầu. Theo dõi các chẩn đoán được tạo ra cho các biểu thức JSON được đặt trong dấu ngoặc kép và xác minh rằng cú pháp GitHub Actions hợp lệ không còn báo lỗi trong consuming workflow hoặc ánh xạ chúng đến sai dòng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github-actions, typescript, vscode
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100