Skip to content

Split Matrix

Actions

About

Splits a JSON array into groups for GitHub Actions matrix strategy.
v0.1.0
Latest
Star (0)

Split Matrix Action

CI GitHub Marketplace

Splits a JSON array into groups for GitHub Actions matrix strategy.

Usage

Example

jobs:
  split-matrix:
    steps:
      - name: Split Matrix
        id: split-matrix
        uses: ovsds/split-matrix-action@v1
        with:
          matrix: '["pkg-1", "pkg-2", "pkg-3", "pkg-4", "pkg-5"]'
          target-group-size: 2
          result-item-prefix: "/data/"

      - name: Use matrix
        run: echo '${{ steps.split-matrix.outputs.matrix }}'
        # Output: ["/data/pkg-1 /data/pkg-2","/data/pkg-3 /data/pkg-4","/data/pkg-5"]

Action Inputs

inputs:
  matrix:
    description: |
      JSON array of strings to split into groups
    required: true
  target-group-size:
    description: |
      Number of items per group
    required: false
    default: "10"
  result-format:
    description: |
      Output format for groups. Supported: "plain"
    required: false
    default: "plain"
  result-format-plain-separator:
    description: |
      Separator to join items within a group (used when result-format is "plain")
    required: false
    default: " "
  result-item-prefix:
    description: |
      Prefix to prepend to each item
    required: false
    default: ""

Action Outputs

outputs:
  matrix:
    description: |
      JSON array of grouped strings

Development

Global dependencies

  • mise, activated in the shell (eval "$(mise activate zsh)")

All other tools are pinned in mise.toml.

mise tasks

For all commands see mise.toml or mise tasks ls.

License

MIT

Split Matrix is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Splits a JSON array into groups for GitHub Actions matrix strategy.
v0.1.0
Latest

Split Matrix is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.