Adding extra variables when using self hosted runners

I’m trying to add extra configuration when using one of my self hosted runners, and I have the following:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [[self-hosted, linux, x64]]
        extraStuff: ['']
        include:
          - os: [self-hosted, macos, x64]
            extraStuff: 'SomeThing'

However, I’m getting errors because The workflow is not valid. Unexpected type 'SequenceToken' encountered while reading 'matrix filter'. The type 'MappingToken' was expected..

Is there any way I can add extra configuration when using self hosted runners?

@Arcnor,

The following are the examples I have tested, but all of them did not work.

matrix:
  os: [[self-hosted, Linux, x64], macos-latest]
  another-option: [value1, value2]
  include:
    - os: [self-hosted, Windows, x64]
      another-option: value3
. . .
  include:
    - os: "[self-hosted, Windows, x64]"  # using single quotes ('...') returns the same result
      another-option: value3

. . .
include:
- { os: [self-hosted, Windows, x64], another-option: value3 }

. . .
  include:
    - { os: "[self-hosted, Windows, x64]", another-option: value3 }  # using single quotes ('...') returns the same result

I also tried os: ${{ [self-hosted, Windows, x64] }} and os: ([self-hosted, Windows, x64]) , still did not work.

Not sure what is the correct expression syntax to use self-hosted runners on the include or exclude key.
I have reported this question to the appropriate engineering team for further investigation and evaluation. If they have any progress, I will notify you in time, and sometimes the appropriate engineers may directly reply you here.

investigating… i was able to reproduce locally and it looks like a bug to me.

I merged a fix that should rollout to production sometime next week.

Thank you both. For some reason I didn’t get emails for the first two replies.

Thanks!