github / github/vscode-github-actions

Do not warn about missing values if a fallback is provided

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

Beschreibung

**Is your feature request related to a problem? Please describe.**
I want to allow many values to be overridden using `vars` but still provide defaults/fallback values when the var is not set. This is possible with the "or" operator:

```
${{vars.optional_config || 'default value'}}
```

However, this currently generates a warning "Context access might be invalid: optional_config"

**Describe the solution you'd like**
The static analyser should detect that the `||` operator provides a default and not generate a warning.

Alternatively, provide a function (e.g. `val_or_default(vars.optional_config, 'default value')`) to make the user's intention explicit to the linter.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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