Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce function split() for strings #865

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sshymko
Copy link

@sshymko sshymko commented Dec 17, 2020

Introduce counterpart to join() function for simple arrays where JSON format would be an overkill.

Usage example with dynamic jobs:

name: Dynamic jobs
on:
  workflow_dispatch:
    inputs:
      versions:   
jobs:
  deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: ${{ split(github.event.inputs.versions, ',') }}
    name: Deploy version ${{ matrix.version }}
    steps:
      - run: echo "hello world"

Sample input:

{
  "versions": "1,2,3"
}

@sshymko
Copy link
Author

sshymko commented Dec 17, 2020

Would appreciate if someone could help to fix the compilation error:

The type or namespace name 'FilteredArray' could not be found

Or provide an example of how to return array from expression functions.
Can it simply return str.Split(separator) without EvaluationResult.CreateIntermediateResult()?

@76creates
Copy link

This is good fn addition, would be nice if we could get this ball rolling ⚡

@JoannaaKL JoannaaKL requested a review from a team as a code owner June 1, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants