github / github/vscode-github-actions

Error thrown in consuming workflows regarding JSON output values quotes

Offen
#464 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
TypeScript
Sterne
660
Forks
213
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den Fehler mit dem im Issue gezeigten reusable workflow und consuming workflow zu reproduzieren, wobei die gemeldete Erweiterungsversion als Ausgangspunkt verwendet wird. Verfolge die für in Anführungszeichen gesetzte JSON-Ausdrücke erzeugten Diagnosen und überprüfe, dass gültige GitHub Actions-Syntax im consuming workflow keine Fehler mehr meldet oder sie der falschen Zeile zuordnet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github-actions, typescript, vscode
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.