github / github/vscode-github-actions

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

Aberta
#428 1 comentário 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
TypeScript
Estrelas
660
Forks
213
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
typescript
Domínio
tooling
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.