Skip to content

Commit

Permalink
feat: setup project
Browse files Browse the repository at this point in the history
  • Loading branch information
xom9ikk committed Dec 5, 2020
0 parents commit 7792b7b
Show file tree
Hide file tree
Showing 13 changed files with 3,890 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
.idea/
.vscode/
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'airbnb-typescript/base',
],
parserOptions: {
ecmaVersion: 2020,
project: './tsconfig.json',
},
env: {
node: true,
},
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.idea/
.vscode/
5 changes: 5 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
"hooks": {
"pre-commit": "npm run lint:fix"
}
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
.idea/
.vscode/
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"parser": "typescript"
};
44 changes: 44 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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, <br> **_1**: 17, <br> **_2**: 3
| `length` | output array length. | 3
24 changes: 24 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
author: Max Romanyuta
name: Simple Split
description: This action will split the string by separator
branding:
icon: feather
color: white
inputs:
string:
description: String to split
required: true
separator:
description: Separator to split a string
required: false
default: ' '
limit:
description: Limit on the number of substrings to be included in the array
default: '-1'
required: false
outputs:
result:
description: Action Result
runs:
using: node12
main: ./dist/index.js
1 change: 1 addition & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7792b7b

Please sign in to comment.