runner icon indicating copy to clipboard operation
runner copied to clipboard

Action matrix schema is invalid

Open ben-wilson-peak opened this issue 2 years ago • 6 comments

Describe the bug The schema for validating actions is invalid for matrices. In the online editor it marks a job as invalid, but the runner understands the syntax and is arguably a completely valid and useful way to define the matrix

To Reproduce Steps to reproduce the behavior:

  1. Using the online action editor
  2. Create a new action
  3. Add a matrix like this:
    strategy:
      matrix:
        bar:
          - os: macos-latest
            version: 12
            environment: prod
          - os: windows-latest
            version: 16
          - os: ubuntu-latest
            version: 16
  1. You should see (in the example foo) is underlined with Matrix options must only contain primitive values

Expected behavior Linting should not highlight the matrix as invalid, the runner accepts it and is presumably supported syntax

Runner Version and Platform

N/A

What's not working?

See instructions

image

Job Log Output

N/A

Runner and Worker's Diagnostic Logs

N/A

Adding the term "Matrix options must only contain primitive values" as plain text so google can pick it up for indexing if others have the problem. You're welcome :D

ben-wilson-peak avatar Jan 11 '23 13:01 ben-wilson-peak

I've filed this as a bug under this repository because the schema is located here, nor is this a support request. I'd like clarification on if it is intended to be supported and if so this should be considered a valid bug request. Much appreciated for any help!

ben-wilson-peak avatar Jan 11 '23 13:01 ben-wilson-peak

Hey @ben-wilson-peak,

custom names are for primitive values, for example

os: [macos-latest, windows-latest, ubuntu-latest]

If you want array of objects you can use include as shown below

matrix:
  include:
       - os: macos-latest
          version: 12
          environment: prod
       - os: windows-latest
          version: 16
       - os: ubuntu-latest
          version: 16

ruvceskistefan avatar Jan 24 '23 09:01 ruvceskistefan

Hey @ben-wilson-peak,

custom names are for primitive values, for example

os: [macos-latest, windows-latest, ubuntu-latest]

If you want array of objects you can use include as shown below

matrix:
  include:
       - os: macos-latest
          version: 12
          environment: prod
       - os: windows-latest
          version: 16
       - os: ubuntu-latest
          version: 16

Hi, the runner supports more than primitives in custom names, it's just the json spec which is suggesting otherwise. I'm using it right now, as are many others. The only problem is it's not documented, it shows up as invalid in the editor and in the long run we don't know that it's supported (which is silly since include is just a merge).

I use this currently in json payloads to configure the matrix dynamically

ben-wilson-peak avatar Jan 25 '23 17:01 ben-wilson-peak

Related: the matrix context documentation says that all properties are string-valued, which is even more restrictive than primitive values.

https://github.com/github/docs/issues/26469

rotu avatar Jul 03 '23 19:07 rotu

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Aug 05 '24 00:08 github-actions[bot]

🍞

rotu avatar Aug 05 '24 00:08 rotu