Skip to content

Matrix jobs dynamic output #2499

@caio-eiq

Description

@caio-eiq

Describe the bug
When using the new dynamic output for matrix jobs feature released in the latest version the workflow won't start. The PR merged and released to v2.303.0 is #2477.

To Reproduce
Steps to reproduce the behavior:

  1. Write a simple workflow with using Matrix
  2. Define an output

(Example):

  deploy:
    needs: [pre-check]
    runs-on: ubuntu-latest
    strategy:
      matrix:
        NAMES: ${{ fromJson(needs.pre-check.outputs.NAMES) }}
    outputs:
      ${{ matrix.NAMES }}_result: ${{ steps.matrix_output.outputs.JOB_STATUS }}
    steps:
      - name: Check status
         id: matrix_output
         run: "JOB_STATUS=FAILURE" >> $GITHUB_OUTPUT

Expected behavior
The dynamic $matrix variable should be supported to use in the outputs key as per the PR #2477 merged and released a couple of weeks ago.

Runner Version and Platform

Version of your runner? v2.303.0

OS of the machine running the runner? Linux (Ubuntu-latest)

What's not working?

The workflow won't even start since the $matrix variable can't be recognized.

ERROR:

Invalid workflow file: .github/workflows/dev.yml#L68)
The workflow is not valid. .github/workflows/dev.yml (Line: 68, Col: 7): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.NAMES

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions