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

split@v1

Github Action for splitting strings into parts by separator with limit

🔥 Usage

jobs:
build:
runs-on: ubuntu-16.04steps:
- name: Split version codeuses: xom9ikk/split@v1id: splitwith:
string: 2.17.3separator: .limit: -1
- name: Some other actionwith:
major: ${{ steps.split.outputs._0 }}minor: ${{ steps.split.outputs._1 }}patch: ${{ steps.split.outputs._2 }}

✨ Features

  • 🧲 splitting a string by separator;
  • 📎 setting a limit for the resulting array;
  • 💎 simple API;

💡 Input

propertyisRequireddefaultcommentexample
stringstring to split.2.17.3
separatorspaceseparator to split a string..
limit-1limit on the number of substrings to be included in the array (use -1 to save all parts).-1

📦 Output

propertycommentexample
_${index}part that has been separated by a separator._0: 2,
_1: 17,
_2: 3
lengthoutput array length.3

About

Github Action for splitting strings into parts by separator with limit

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages