github / github/vscode-github-actions

Support Custom GitHub Action use of GITHUB_ENV

Aberta
#47 14 comentários 42 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
TypeScript
Estrelas
660
Forks
213
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

**Is your feature request related to a problem? Please describe.**
Some GitHub Actions use `GITHUB_ENV` to set up custom environment variables.
When used inside a workflow, use `${{ env.CUSTOM_VARIABLE }}` is flagged as `Context access might be invalid`.

**Describe the solution you'd like**
Enable the custom GitHub Actions developer to define statically or dynamically the generated environment variables (like for the action output) and use it in this plugin to remove false-positive.

**Additional context**

This workflow is flagged with the issue

```yaml
name: "Context access might be invalid"
on: push
jobs:
context-access-might-be-invalid:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup environment variables
uses: rlespinasse/github-slug-action@v4

- name: Print custom environment variables
run: echo ${{ env.GITHUB_REF_SLUG }}
```
And produces
Capture d’écran 2023-03-28 à 20 15 36

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

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