Skip to content

ovsds/split-matrix-action

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

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

Taskfile commands

For all commands see Taskfile or task --list-all.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors