github / github/vscode-github-actions
The `runner.environment` context is shown as invalid in this extension.
- Dominant language
- TypeScript
- Stars
- 660
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
**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**

**Extension Version**
`v0.27.0`
**Additional context**
Add any other context about the problem here.
Contributor guide
Research direction
Start by reproducing the supplied workflow snippet in the extension and inspect the context-validation path that produces the Problems-panel warning. The work is done when runner.environment is recognized according to the linked GitHub Actions runner-context documentation and the warning no longer appears for this expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100