https://github.com/xom9ikk/split
Github Action for splitting strings into parts by separator with limit
https://github.com/xom9ikk/split
actions github github-actions node split
Last synced: 6 months ago
JSON representation
Github Action for splitting strings into parts by separator with limit
- Host: GitHub
- URL: https://github.com/xom9ikk/split
- Owner: xom9ikk
- Created: 2020-12-05T18:00:49.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T07:29:07.000Z (almost 2 years ago)
- Last Synced: 2025-07-14T15:33:58.866Z (7 months ago)
- Topics: actions, github, github-actions, node, split
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/simple-split
- Size: 191 KB
- Stars: 5
- Watchers: 1
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# split@v1
> Github Action for splitting strings into parts by separator with limit
## 🔥 Usage
```yaml
jobs:
build:
runs-on: ubuntu-16.04
steps:
- name: Split version code
uses: xom9ikk/split@v1
id: split
with:
string: 2.17.3
separator: .
limit: -1
- name: Some other action
with:
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
| property | isRequired | default | comment | example
|------------|:----------:|:-------:|-------------------------------------------------------------------------------------------|:--------:
| `string` | ✓ | | string to split. | 2.17.3
| `separator`| | space | separator to split a string. | .
| `limit` | | -1 | limit on the number of substrings to be included in the array (use -1 to save all parts). | -1
## 📦 Output
| property | comment | example
|-------------|----------------------------------------------|---------
| `_${index}` | part that has been separated by a separator. | **_0**: 2,
**_1**: 17,
**_2**: 3
| `length` | output array length. | 3