{"id":16201386,"url":"https://github.com/druzsan/setup-matrix","last_synced_at":"2026-04-27T20:32:45.490Z","repository":{"id":156603751,"uuid":"616488059","full_name":"druzsan/setup-matrix","owner":"druzsan","description":"GitHub action to create a reusable and potentially dynamic matrix for workflow jobs.","archived":false,"fork":false,"pushed_at":"2024-02-09T21:17:18.000Z","size":104,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-16T09:32:15.229Z","etag":null,"topics":["ci","continuous-integration","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/druzsan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-20T13:40:06.000Z","updated_at":"2025-06-09T19:57:33.000Z","dependencies_parsed_at":"2024-02-06T20:48:00.613Z","dependency_job_id":null,"html_url":"https://github.com/druzsan/setup-matrix","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/druzsan/setup-matrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druzsan%2Fsetup-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druzsan%2Fsetup-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druzsan%2Fsetup-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druzsan%2Fsetup-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/druzsan","download_url":"https://codeload.github.com/druzsan/setup-matrix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druzsan%2Fsetup-matrix/sbom","scorecard":{"id":357205,"data":{"date":"2025-08-11","repo":{"name":"github.com/druzsan/setup-matrix","commit":"e52eed47b195a3c2157f91e1baceaa82df2276f2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci-builtin.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/integration-test.yml:1","Warn: no topLevel permission defined: .github/workflows/quickstart.yml:1","Warn: no topLevel permission defined: .github/workflows/unit-test-builtin.yml:1","Warn: no topLevel permission defined: .github/workflows/unit-test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:40","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:41","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:42","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:55","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:56","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:57","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:70","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:71","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/ci.yml:72","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/unit-test.yml:63","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/unit-test.yml:64","Info: Possibly incomplete results: error parsing job operating system: .github/workflows/unit-test.yml:65","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-builtin.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-builtin.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-builtin.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-builtin.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-builtin.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-builtin.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci-builtin.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/integration-test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/integration-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/integration-test.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/integration-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/integration-test.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/integration-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/integration-test.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/integration-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/integration-test.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/integration-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/quickstart.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/quickstart.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test-builtin.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test-builtin.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test-builtin.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test-builtin.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test-builtin.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test-builtin.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test-builtin.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test-builtin.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/unit-test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/unit-test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/unit-test.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/druzsan/setup-matrix/unit-test.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3 to python:3@sha256:819daf0e0d5e5bb88927aea18a9279f870f746c234d45468fd493ab618729866","Warn: pipCommand not pinned by hash: Dockerfile:5","Warn: pipCommand not pinned by hash: Dockerfile:9","Warn: pipCommand not pinned by hash: .github/workflows/ci-builtin.yml:57","Warn: pipCommand not pinned by hash: .github/workflows/ci-builtin.yml:58","Warn: pipCommand not pinned by hash: .github/workflows/ci-builtin.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/ci-builtin.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/ci-builtin.yml:41","Warn: pipCommand not pinned by hash: .github/workflows/ci-builtin.yml:42","Warn: pipCommand not pinned by hash: .github/workflows/unit-test-builtin.yml:61","Warn: pipCommand not pinned by hash: .github/workflows/unit-test-builtin.yml:62","Warn: pipCommand not pinned by hash: .github/workflows/unit-test-builtin.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/unit-test-builtin.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/unit-test-builtin.yml:44","Warn: pipCommand not pinned by hash: .github/workflows/unit-test-builtin.yml:45","Info:   0 out of  20 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  10 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of  14 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2018-49 / GHSA-rprw-h62v-c2w7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T09:54:07.789Z","repository_id":156603751,"created_at":"2025-08-18T09:54:07.790Z","updated_at":"2025-08-18T09:54:07.790Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","continuous-integration","github-actions"],"created_at":"2024-10-10T09:37:34.699Z","updated_at":"2026-04-27T20:32:45.471Z","avatar_url":"https://github.com/druzsan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦 Setup matrix\n\n[![⏱️ Quickstart](https://github.com/druzsan/setup-matrix/actions/workflows/quickstart.yml/badge.svg)](https://github.com/druzsan/setup-matrix/actions/workflows/quickstart.yml) [![🔍 CI](https://github.com/druzsan/setup-matrix/actions/workflows/ci.yml/badge.svg)](https://github.com/druzsan/setup-matrix/actions/workflows/ci.yml) [![🧪 Unit Test](https://github.com/druzsan/setup-matrix/actions/workflows/unit-test.yml/badge.svg)](https://github.com/druzsan/setup-matrix/actions/workflows/unit-test.yml) [![🧪 Integration Test](https://github.com/druzsan/setup-matrix/actions/workflows/integration-test.yml/badge.svg)](https://github.com/druzsan/setup-matrix/actions/workflows/integration-test.yml)\n\nGitHub action to create reusable dynamic job matrices for your workflows.\n\nThis action adresses a wide known problem of reusing the same job matrix\nmultiple times or even generating a matrix on the fly.\n\nThe main goal of this action is to be as much compatible with built-in\n[GitHub matrices](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs)\nas possible and thus allow you a smooth transition in your workflow.\n\nAll given examples can be found as GitHub [workflows](https://github.com/druzsan/setup-matrix/tree/main/.github/workflows) and respective [runs](https://github.com/druzsan/setup-matrix/actions).\n\n## ⏱️ Quickstart\n\nModified [matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations) example.\n\n```yaml\njobs:\n  # Setup matrix\n  setup-matrix:\n    runs-on: ubuntu-latest\n    outputs:\n      matrix: ${{ steps.setup-matrix.outputs.matrix }}\n    steps:\n      - id: setup-matrix\n        uses: druzsan/setup-matrix@v2\n        with:\n          # Use | to preserve valid YAML syntax\n          matrix: |\n            fruit: [apple, pear]\n            animal: [quick red fox, lazy dog]\n            include:\n              - color: green\n              - color: pink\n                animal: quick red fox\n              - color: brown\n                animal: cat\n            exclude:\n              - fruit: apple\n                animal: lazy dog\n  # Setup python and print version\n  echo:\n    needs: setup-matrix\n    strategy:\n      matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}\n    runs-on: ubuntu-latest\n    steps:\n      - run: |\n          echo \"fruit: ${{ matrix.fruit }}, animal: ${{ matrix.fruit }}, color: ${{ matrix.color }}\"\n```\n\nWorkflow [runs](https://github.com/druzsan/setup-matrix/actions/workflows/quickstart.yml).\n\nFor more examples, see [advanced usage](#advanced-usage)\n\n## 📥 Inputs\n\nAction has only one required input `matrix`, whose syntax is exactly the same as the built-in matrix provided as string.\n\nFull YAML syntax is supported inside input, so you even can add inline comments which will be ignored during parsing.\n\nNot only syntax validity, but also built-in matrix restrictions (e.g. empty resulting matrix) are checked. Error logs try to give as much infomation on problem as possible.\n\nIt is highly recommended to use `|` prefix for multi-line strings:\n\n```yaml\nuses: druzsan/setup-matrix@v2\nwith:\n  matrix: | # Setup matrix with OS and Python version\n    os: [ubuntu-latest, windows-latest]\n    python-version: [3.8, 3.10, 3.12]\n    include:\n      - os: windows-latest\n        python-version: 3.8  # Only use Python 3.8 for MacOS\n    exclude:\n      - os: windows-latest\n        python-version: 3.12  # Do not use Python 3.12 for Windows\n```\n\nFlow YAML syntax is also supported:\n\n```yaml\nuses: druzsan/setup-matrix@v2\nwith:\n  matrix: '{ os: [ubuntu-latest, windows-latest], python-version: [3.8, 3.10, 3.12] }'\n```\n\n## 📤 Outputs\n\nParsed matrix is printed inside the action step as a pretty formated YAML, so you can visually inspect it.\n\nParsed matrix is also set as `MATRIX` environment variable.\n\n### `matrix`\n\nvalid JSON matrix ready to be set as `jobs.\u003cjob_id\u003e.outputs` used in\n`jobs.\u003cjob_id\u003e.strategy`:\n\n```yaml\nstrategy:\n  matrix: ${{ fromJson(needs.\u003cjob_id\u003e.outputs.matrix) }}\n```\n\n## 💪 Advanced Usage\n\n### ♻️ Reusable Matrix\n\nSometimes you need to run different jobs on the same set of configurations, e.g.\ncheck code formatting, code types and lint code.\n\nBuild matrix:\n\n```yaml\nsetup-matrix:\n  runs-on: ubuntu-latest\n  outputs:\n    matrix: ${{ steps.setup-matrix.outputs.matrix }}\n  steps:\n    - id: setup-matrix\n      uses: druzsan/setup-matrix@v2\n      with:\n        matrix: |\n          os: [ubuntu-latest, windows-latest, macos-latest]\n          python-version: [3.8, 3.10, 3.12]\n```\n\nReuse matrix:\n\n```yaml\ncheck-format:\n  needs: setup-matrix\n  strategy:\n    matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}\n  runs-on: ${{ matrix.os }}\n  steps:\n    - uses: actions/checkout@v4\n    - uses: actions/setup-python@v5\n      with:\n        python-version: ${{ matrix.python-version }}\n    - run: python -m pip install -IU pip setuptools wheel\n    - run: pip install -IUr requirements.txt -r requirements-dev.txt\n    - run: black --check .\ntypecheck:\n  needs: setup-matrix\n  strategy:\n    matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}\n  runs-on: ${{ matrix.os }}\n  steps:\n    - uses: actions/checkout@v4\n    - uses: actions/setup-python@v5\n      with:\n        python-version: ${{ matrix.python-version }}\n    - run: python -m pip install -IU pip setuptools wheel\n    - run: pip install -IUr requirements.txt -r requirements-dev.txt\n    - run: mypy main.py \u0026\u0026 mypy tests\nlint:\n  needs: setup-matrix\n  strategy:\n    matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}\n  runs-on: ${{ matrix.os }}\n  steps:\n    - uses: actions/checkout@v4\n    - uses: actions/setup-python@v5\n      with:\n        python-version: ${{ matrix.python-version }}\n    - run: python -m pip install -IU pip setuptools wheel\n    - run: pip install -IUr requirements.txt -r requirements-dev.txt\n    - run: ruff check main.py tests\n```\n\nFull [solution](.github/workflows/ci.yml) using the `setup-matrix` action and its [runs](https://github.com/druzsan/setup-matrix/actions/workflows/ci.yml).\n\n[Solution](.github/workflows/ci-builtin.yml) using the built-in matrix and its [runs](https://github.com/druzsan/setup-matrix/actions/workflows/ci-builtin.yml).\n\n### 🌊 Dynamic Matrix\n\nSometimes you need to run a job on different sets of configurations, depending\non branch, triggering event etc.\n\nBuild matrix:\n\n```yaml\nsetup-matrix:\n  runs-on: ubuntu-latest\n  outputs:\n    matrix: ${{ steps.setup-matrix.outputs.matrix }}\n  steps:\n    # Setup matrix on a dev branch\n    - if: startsWith(github.ref, 'refs/tags/')\n      uses: druzsan/setup-matrix@v2\n      with:\n        matrix: |\n          os: [ubuntu-latest, windows-latest, macos-latest]\n          python-version: [3.8, 3.10, 3.12]\n    # Setup matrix on the main branch\n    - if: github.ref == 'refs/heads/main'\n      uses: druzsan/setup-matrix@v2\n      with:\n        matrix: |\n          os: [ubuntu-latest]\n          python-version: [3.8, 3.10, 3.12]\n          include:\n            - os: windows-latest\n              python-version: 3.8\n            - os: macos-latest\n              python-version: 3.8\n    # Setup matrix on a tag\n    - if: github.ref != 'refs/heads/main' \u0026\u0026 !startsWith(github.ref, 'refs/tags/')\n      uses: druzsan/setup-matrix@v2\n      with:\n        matrix: |\n          os: [ubuntu-latest]\n          python-version: [3.8]\n    # MATRIX environment variable is set by the last executed action\n    - id: setup-matrix\n      run: echo \"matrix=$MATRIX\" \u003e\u003e $GITHUB_OUTPUT\n```\n\nUse dynamic matrix:\n\n```yaml\nunit-test:\n  needs: setup-matrix\n  strategy:\n    matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}\n  runs-on: ${{ matrix.os }}\n  steps:\n    - uses: actions/checkout@v4\n    - uses: actions/setup-python@v5\n      with:\n        python-version: ${{ matrix.python-version }}\n    - run: python -m pip install -IU pip setuptools wheel\n    - run: pip install -IUr requirements.txt -r requirements-dev.txt\n    - run: python -m pytest\n```\n\nFull [solution](.github/workflows/unit-test.yml) using the `setup-matrix` action and its [runs](https://github.com/druzsan/setup-matrix/actions/workflows/unit-test.yml).\n\n[Solution](.github/workflows/unit-test-builtin.yml) using the built-in matrix and its [runs](https://github.com/druzsan/setup-matrix/actions/workflows/unit-test-builtin.yml).\n\n## ℹ️ Limitations\n\nSince the action uses Python and Dockerfile, is is mandatory to run it on an Ubuntu runner.\n\n## ⚠️ Breaking Changes\n\nVersion 1 syntax is no longer supported. Update inputs when switching to version 2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruzsan%2Fsetup-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdruzsan%2Fsetup-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruzsan%2Fsetup-matrix/lists"}