vscode-github-actions icon indicating copy to clipboard operation
vscode-github-actions copied to clipboard

Using matrix context value for `runs-on`

Open mrnossiom opened this issue 4 years ago • 1 comments

Hello, when using matrix.os, the extension resolve it to true.

name: Node.js CI

on: [push, pull_request]

jobs:
    test:
        strategy:
            fail-fast: true
            matrix:
                os:
                    - ubuntu-latest
                    - windows-latest
                    - macos-latest
        name: Test on Node.js v16 on ${{ matrix.os }}
        runs-on: ${{ matrix.os }}
        env:
            TOKEN: ${{ secrets.DISCORD_TEST_TOKEN }}
            DATABASE_URL: postgresql://MeTomT:aSecretPassword@localhost/MeTomT
        steps:
            - name: Checkout code
              uses: actions/checkout@v2

I have this error: 'true' is not in the list of allowed values

{
	"resource": "/path/to/project/folder/.github/workflows/main.yml",
	"owner": "github-actions",
	"severity": 8,
	"message": "'true' is not in the list of allowed values",
	"startLineNumber": 15,
	"startColumn": 18,
	"endLineNumber": 15,
	"endColumn": 34
}

Is it a problem from my configuration, or is there a bug ?

Thanks for any answers MrNossiom

mrnossiom avatar Jul 09 '21 14:07 mrnossiom

No this is a bug. At "design-time" here, I would need to keep track that matrix.os could mean any of ubuntu-latest/windows-latest/macos-latest and check all values against the allowed values for runs-on. Currently it's only tracked that a variable matrix.os exists at all -- no specific value is assigned.

cschleiden avatar Jul 12 '21 15:07 cschleiden

This should work now.

cschleiden avatar Mar 22 '23 16:03 cschleiden