github / github/vscode-github-actions

The `runner.environment` context is shown as invalid in this extension.

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

説明

**Describe the bug**
When we use the `runner.environment` context listed in [official document](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context), this extension reports "Context access might be invalid".

**To Reproduce**
Steps to reproduce the behavior:
1. With this workflow '...'

```yaml
steps:
- if: ${{ runner.environment == 'github-hosted' }}
run: echo "This is a ${{ runner.environment }} runner"
```

2. Do this '...'

Open the "Problems" Panel.

3. See error\

```plain
Context access might be invalid: environment
```

**Expected behavior**
The `runner.environment` context listed in [official document](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context) can be recognized well by this extension.

**Screenshots**
![image](https://github.com/user-attachments/assets/335f46d8-d511-4f91-a2dd-5c78b5c0c1e3)

**Extension Version**
`v0.27.0`

**Additional context**
Add any other context about the problem here.

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

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

調査の方向性

まず、提供された workflow スニペットを拡張機能で再現し、Problems-panel の警告を生成するコンテキスト検証パスを調査します。runner.environment がリンク先の GitHub Actions の runner コンテキストに関するドキュメントに従って認識され、この式に対する警告が表示されなくなれば、作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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