mirror of
https://github.com/actions-hub/stylelint.git
synced 2024-10-05 18:14:23 -04:00
removed INPUTS
This commit is contained in:
parent
25e478115b
commit
5ecadb2371
3 changed files with 10 additions and 30 deletions
23
README.md
23
README.md
|
@ -10,13 +10,12 @@ To use stylelint in your workflow just add this step:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Action has 3 parameters which you can set:
|
Action has 3 parameters which you can set:
|
||||||
- PATTERN - Pattern for style files.
|
- PATTERN - Pattern for style files.
|
||||||
- CONFIG_PATH - Path to stylelint configuration file
|
- CONFIG_PATH - Path to stylelint configuration file
|
||||||
- INDENT_SPACE - Space indentation
|
- INDENT_SPACE - Space indentation
|
||||||
|
|
||||||
This parameter can be set throw environment variables:
|
This parameters can be set throw environment variables:
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions-hub/stylelint@master
|
- uses: actions-hub/stylelint@master
|
||||||
env:
|
env:
|
||||||
|
@ -24,14 +23,6 @@ This parameter can be set throw environment variables:
|
||||||
PATTERN: "*.scss"
|
PATTERN: "*.scss"
|
||||||
```
|
```
|
||||||
|
|
||||||
Or throw inputs:
|
|
||||||
```bash
|
|
||||||
- uses: actions-hub/stylelint@master
|
|
||||||
with:
|
|
||||||
indent_spaces: 4
|
|
||||||
pattern: "*.scss"
|
|
||||||
```
|
|
||||||
|
|
||||||
### .stylelintrc
|
### .stylelintrc
|
||||||
By default, action will try to find an existing configuration file in the project.
|
By default, action will try to find an existing configuration file in the project.
|
||||||
If the configuration file will not found, it will be created with the next configuration:
|
If the configuration file will not found, it will be created with the next configuration:
|
||||||
|
@ -50,19 +41,17 @@ If you want to specify which file or types must be validated.
|
||||||
You need to pass the pattern as a `PATTERN` variable.
|
You need to pass the pattern as a `PATTERN` variable.
|
||||||
By default, it will try to find `*.css`.
|
By default, it will try to find `*.css`.
|
||||||
|
|
||||||
|
|
||||||
### Indentation
|
### Indentation
|
||||||
Indentation can be set by environment variable `INDENT_SPACES`.
|
Indentation can be set by environment variable `INDENT_SPACES`.
|
||||||
By default space, indent is 2.
|
By default space, indent is 2.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions-hub/stylelint@master
|
- uses: actions-hub/stylelint@master
|
||||||
with:
|
ENV:
|
||||||
indent_spaces: 4
|
INDENT_SPACES: 4
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
### Default values
|
### Default values
|
||||||
```bash
|
```bash
|
||||||
name: Test
|
name: Test
|
||||||
|
@ -91,9 +80,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions-hub/stylelint@master
|
- uses: actions-hub/stylelint@master
|
||||||
with:
|
env:
|
||||||
pattern: "*.scss"
|
PATTERN: "*.scss"
|
||||||
indent_spaces: 4
|
INDENT_SPACES: 4
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
10
action.yml
10
action.yml
|
@ -4,16 +4,6 @@ author: 'Serhiy Mytrovtsiy <mitrovtsiy@ukr.net>'
|
||||||
branding:
|
branding:
|
||||||
icon: 'layout'
|
icon: 'layout'
|
||||||
color: 'black'
|
color: 'black'
|
||||||
inputs:
|
|
||||||
pattern:
|
|
||||||
description: 'Pattern for style files.'
|
|
||||||
default: './*.css'
|
|
||||||
config_path:
|
|
||||||
description: 'Path to stylelint configuration file.'
|
|
||||||
default: './'
|
|
||||||
indent_space:
|
|
||||||
description: 'Space indentation.'
|
|
||||||
default: 2
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
configPath=$INPUT_CONFIG_PATH
|
configPath="./"
|
||||||
indentSpaces=$INPUT_INDENT_SPACES
|
indentSpaces=2
|
||||||
pattern=$INPUT_PATTERN
|
pattern="*.css"
|
||||||
|
|
||||||
if [ ! -z "${CONFIG_PATH}" ]; then
|
if [ ! -z "${CONFIG_PATH}" ]; then
|
||||||
configPath=$CONFIG_PATH
|
configPath=$CONFIG_PATH
|
||||||
|
@ -32,4 +32,5 @@ fi
|
||||||
|
|
||||||
echo ::add-path::${stylelint_path}
|
echo ::add-path::${stylelint_path}
|
||||||
|
|
||||||
|
echo $pattern
|
||||||
sh -c "$stylelint_path $pattern"
|
sh -c "$stylelint_path $pattern"
|
Loading…
Reference in a new issue