github / github/vscode-github-actions

Do not warn about missing values if a fallback is provided

オープン
#76 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る
enhancement
主要言語
TypeScript
スター
660
フォーク
213
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。