github / github/vscode-github-actions

Support Custom GitHub Action use of GITHUB_ENV

Offen
#47 14 Kommentare 42 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
TypeScript
Sterne
660
Forks
213
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.