forked from xom9ikk/split
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7792b7b
Showing
13 changed files
with
3,890 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/ | ||
node_modules/ | ||
.idea/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.idea/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
"hooks": { | ||
"pre-commit": "npm run lint:fix" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/ | ||
node_modules/ | ||
.idea/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.