cschleiden / vscode-github-actions

Simple, unofficial extension to view GitHub Actions workflows and runs in VS Code
https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions
MIT License
302 stars 35 forks source link

Using reusable secrets and input in env is marked as invalid or unknown. #217

Closed schwern closed 1 year ago

schwern commented 1 year ago

In this reusable workflow...

name: Test matrix (reusable)

on:
  workflow_call:
    secrets:
      auth-token:
        description: 'Auth token used for live testing'
        required: false
    inputs:
      live:
        description: 'If true, run tests against a real server'
        default: false
        type: boolean
      cache-name:
        description: 'The cache name to use for live testing'
        default: ruby-integration-test-cache
        type: string

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby-version:
          - 2.7
          - 3.0
          - 3.1

    steps:
    - uses: actions/checkout@v3

    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby-version }}
        bundler-cache: true

    - name: Run tests
      run: bundle exec rspec
      env:
        TEST_AUTH_TOKEN: ${{ secrets.auth-token }}
        TEST_CACHE_NAME: ${{ inputs.cache-name }}-${{ matrix.ruby-version }}
        MOMENTO_TEST_LIVE: ${{ inputs.live }}

It claims that using the secrets and inputs in env are invalid or unknown access, but the workflow works fine.

[{
    "resource": "/Volumes/Momento/client-sdk-ruby/.github/workflows/test.yml",
    "owner": "github-actions",
    "severity": 8,
    "message": "Unknown context access: 'secrets.auth-token'",
    "startLineNumber": 41,
    "startColumn": 26,
    "endLineNumber": 41,
    "endColumn": 51
},{
    "resource": "/Volumes/Momento/client-sdk-ruby/.github/workflows/test.yml",
    "owner": "github-actions",
    "severity": 8,
    "message": "Invalid expression",
    "startLineNumber": 42,
    "startColumn": 26,
    "endLineNumber": 42,
    "endColumn": 50
},{
    "resource": "/Volumes/Momento/client-sdk-ruby/.github/workflows/test.yml",
    "owner": "github-actions",
    "severity": 8,
    "message": "Invalid expression",
    "startLineNumber": 43,
    "startColumn": 28,
    "endLineNumber": 43,
    "endColumn": 46
}]
cschleiden commented 1 year ago

Thanks for the report! The current version of the extension doesn't support re-usable workflows yet, but we are working on updating this. Hope to share some news soon 🤞

cschleiden commented 1 year ago

This should be fixed now.