Skip to content

Variables values with spaces #6

@ghost

Description

I'm testing actions using a matrix with the spaces. And it produces 4 jobs instead of 2 because of the command {python3 --version}. Is there a way to use variables with spaces?

name: Matrix
on:
  push:
  workflow_dispatch:

jobs:
  prepare:
    runs-on: ubuntu-latest
    steps:
      - name: Create matrix
        id: create_matrix
        uses: fabiocaccamo/create-matrix-action@v3
        with:
          matrix: |
            python-version {3.8}, command {python3 --version}
            python-version {3.9}, command {python3 --version}
    outputs:
      matrix: ${{ steps.create_matrix.outputs.matrix }}

  test:
    needs: prepare
    runs-on: ubuntu-latest
    name: ${{ matrix.python-version}}
    strategy:
      fail-fast: false
      matrix:
        include: ${{fromJson(needs.prepare.outputs.matrix)}}
    steps:
      - name: Debug matrix
        run: |
          echo "${{ matrix.python-version }} / ${{ matrix.command }}"
Screenshot 2024-02-05 at 18 54 02

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions