github / github/vscode-github-actions

Missing expression syntax or escaping for `if: ! expr` is not detected

Aperta
#290 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
TypeScript
Stelle
660
Fork
213
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The following is not validated (from [github docs](https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution)):

> You must always use the ${{ }} expression syntax or escape with '', "", or () when the expression starts with !, since ! is reserved notation in YAML format. For example:
>
> ```
> if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
> ```
>
> For more information, see "[Expressions](https://docs.github.com/en/actions/learn-github-actions/expressions)."

Currently, this will not be detected as a bug:
```
if: ! startsWith(github.ref, 'refs/tags/')
```

The runner will abort with:
```
The workflow is not valid. .github/workflows/build.yml: (Line: 42, Col: 42, Idx: 420) - (Line: 42, Col: 43, Idx: 421): While parsing a tag, did not find expected tag URI.
```

It should be linted as an error.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci l'espressione senza escape dell'issue in .github/workflows/build.yml e confrontala con la forma con escape documentata. Traccia il punto di ingresso attuale della convalida del workflow dell'estensione e la diagnostica esistente; il lavoro è completato quando la forma senza escape riceve un errore di lint, mentre le forme valide con escape e quelle di espressione continuano a essere accettate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
github-actions, typescript
Ambito
ci-cd, devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.