Skip to content

What is a valid matrix value? #26469

Closed
@rotu

Description

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/learn-github-actions/contexts#matrix-context
https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs

What part(s) of the article would you like to see updated?

The contents of the matrix context is described as string-valued. But it's not clear if this is always correct. It's also not clear what is legal to provide for a matrix in the first place.

Additional information

e.g. In the example here https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy , version is syntactically a number. It's not clear whether one should expect ${{ matrix.version }} to be coerced to a string.

e.g. If I provide an object value to matrix, it's not clear if it should work. The below code seems to set ${{ matrix.foo }} to the object {"key": true}, but the GitHub's workflow editor complains "Matrix options must only contain primitive values":

jobs:
  example_matrix:
    strategy:
      matrix:
        - foo:
          - key: true

Metadata

Assignees

No one assigned

    Labels

    SME reviewedAn SME has reviewed this issue/PRactionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamfixing internallyThis will be fixed internally

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions