Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Generate Matrix

Test Action

Define a custom reusable matrix

Usage

jobs:
matrix:
name: 'Define matrix'runs-on: ubuntu-24.04steps:
- name: 'Matrix'id: matrixuses: loat-dev/generate-matrix@latestwith:
matrix: | fruit: [apple, pear] animal: [quick red fox, lazy dog] include: - color: green - color: pink animal: quick red fox - color: brown animal: cat exclude: - fruit: apple animal: lazy dogoutputs:
matrix: ${{ steps.matrix.outputs.matrix }}usage:
needs: 'matrix'strategy:
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}runs-on: ubuntu-24.04steps:
- run: | echo "fruit: ${{ matrix.fruit }}, animal: ${{ matrix.fruit }}, color: ${{ matrix.color }}"

Inputs

InputRequired?Description
matrixYesA custom matrix definition

Outputs

OutputDescription
matrixThe parsed matrix definition