github / github/vscode-github-actions
Missing expression syntax or escaping for `if: ! expr` is not detected
- Langage dominant
- TypeScript
- Étoiles
- 660
- Forks
- 213
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez l’expression non échappée de l’issue dans .github/workflows/build.yml et comparez-la avec la forme échappée documentée. Suivez le point d’entrée actuel de la validation du workflow de l’extension et les diagnostics existants ; le travail est terminé lorsque la forme non échappée reçoit une erreur de lint, tandis que les formes échappées et les formes d’expression valides restent acceptées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- github-actions, typescript
- Domaine
- ci-cd, devtools
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100