github / github/vscode-github-actions

Error thrown in consuming workflows regarding JSON output values quotes

未關閉
#464 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
660
分支
213
PR 合併指標
30 天內沒有已合併 PR

描述

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

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing the error with the reusable workflow and consuming workflow shown in the issue, using the reported extension version as a baseline. Trace the diagnostics produced for quoted JSON expressions and verify that valid GitHub Actions syntax no longer reports errors in the consuming workflow or maps them to the wrong line.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
github-actions, typescript, vscode
領域
devtools
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。