Skip to content

Commit 7792b7b

Browse files
committed
feat: setup project
0 parents  commit 7792b7b

File tree

13 files changed

+3890
-0
lines changed

13 files changed

+3890
-0
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
node_modules/
3+
.idea/
4+
.vscode/

.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint'],
4+
extends: [
5+
'airbnb-typescript/base',
6+
],
7+
parserOptions: {
8+
ecmaVersion: 2020,
9+
project: './tsconfig.json',
10+
},
11+
env: {
12+
node: true,
13+
},
14+
};

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.idea/
3+
.vscode/

.huskyrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
"hooks": {
3+
"pre-commit": "npm run lint:fix"
4+
}
5+
}

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
node_modules/
3+
.idea/
4+
.vscode/

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"parser": "typescript"
9+
};

README.MD

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# split@v1
2+
> Github Action for splitting strings into parts by separator with limit
3+
4+
## 🔥 Usage
5+
```yaml
6+
jobs:
7+
build:
8+
runs-on: ubuntu-16.04
9+
10+
steps:
11+
- name: Split version code
12+
uses: xom9ikk/split@v1
13+
id: split
14+
with:
15+
string: 2.17.3
16+
separator: .
17+
limit: -1
18+
19+
- name: Some other action
20+
with:
21+
major: ${{ steps.split.outputs._0 }}
22+
minor: ${{ steps.split.outputs._1 }}
23+
patch: ${{ steps.split.outputs._2 }}
24+
```
25+
26+
## ✨ Features
27+
* 🧲 splitting a string by separator;
28+
* 📎 setting a limit for the resulting array;
29+
* 💎 simple API;
30+
31+
## 💡 Input
32+
33+
| property | isRequired | default | comment | example
34+
|------------|:----------:|:-------:|-------------------------------------------------------------------------------------------|:--------:
35+
| `string` | ✓ | | string to split. | 2.17.3
36+
| `separator`| | space | separator to split a string. | .
37+
| `limit` | | -1 | limit on the number of substrings to be included in the array (use -1 to save all parts). | -1
38+
39+
## 📦 Output
40+
41+
| property | comment | example
42+
|-------------|----------------------------------------------|---------
43+
| `_${index}` | part that has been separated by a separator. | **_0**: 2, <br> **_1**: 17, <br> **_2**: 3
44+
| `length` | output array length. | 3

action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
author: Max Romanyuta
2+
name: Simple Split
3+
description: This action will split the string by separator
4+
branding:
5+
icon: feather
6+
color: white
7+
inputs:
8+
string:
9+
description: String to split
10+
required: true
11+
separator:
12+
description: Separator to split a string
13+
required: false
14+
default: ' '
15+
limit:
16+
description: Limit on the number of substrings to be included in the array
17+
default: '-1'
18+
required: false
19+
outputs:
20+
result:
21+
description: Action Result
22+
runs:
23+
using: node12
24+
main: ./dist/index.js

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)