Skip to content

The pythonLocation environment variable is shown as invalid access in this context #439

@Julfried

Description

@Julfried

Describe the bug

When using the pythonLocation environment variable set by the actions/setup-python action, this extension reports "Context access might be invalid" even though it is a valid environment variable documented in the official setup-python action.

To Reproduce

Steps to reproduce the behavior:

  1. With this workflow:

    name: Test Workflow
    
    on:
      workflow_dispatch:
    
    jobs:
      test:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-python@v5
            with:
              python-version: '3.12'
          - name: Cache pip
            uses: actions/cache@v4
            with:
              path: ${{ env.pythonLocation }}/.cache/pip
              key: python-${{ hashFiles('setup.py', 'pyproject.toml') }}
  2. Open the "Problems" panel in VS Code.

  3. See the error:

    Context access might be invalid: pythonLocation
    

Expected behavior

The pythonLocation environment variable, which is documented and valid when using actions/setup-python, should be recognized properly by this extension.

Screenshots

If applicable, include screenshots of the warning in the Problems panel.

Extension Version

vX.Y.Z

Additional context


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog 🗒

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions