github / github/vscode-github-actions
Error thrown in consuming workflows regarding JSON output values quotes
- Lenguaje dominante
- TypeScript
- Estrellas
- 660
- Forks
- 213
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
**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`
Guía de contribución
Línea de trabajo
Comienza reproduciendo el error con el reusable workflow y el consuming workflow mostrados en el issue, usando como referencia la versión de la extensión indicada. Sigue los diagnósticos producidos para las expresiones JSON entre comillas y verifica que la sintaxis válida de GitHub Actions ya no informe de errores en el consuming workflow ni los asigne a la línea incorrecta.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- github-actions, typescript, vscode
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100