GitHub Action that runs stylelint
Find a file
2024-01-12 17:45:33 +01:00
.github/workflows added success test action 2021-10-22 20:41:41 +02:00
.gitignore check if .stylelintrc* configuration exist 2019-11-11 13:30:12 +01:00
.stylelintrc check if .stylelintrc* configuration exist 2019-11-11 13:30:12 +01:00
action.yml removed INPUTS 2019-11-11 13:12:02 +01:00
Dockerfile set baseimage to the LTS node version 2024-01-12 17:45:33 +01:00
entrypoint.sh fix deprecated set-env and add-path commands 2020-10-09 08:40:45 +02:00
LICENSE Create LICENSE 2019-08-21 22:02:50 +02:00
README.md Update README.md 2020-11-09 17:28:50 -05:00

stylelint

GitHub Action that runs stylelint.

Usage

To use stylelint in your workflow just add this step:

- name: stylelint 
  uses: actions-hub/stylelint@master

Configuration

Action has 3 parameters which you can set:

  • PATTERN - Pattern for style files.
  • CONFIG_PATH - Path to stylelint configuration file
  • INDENT_SPACE - Space indentation

This parameters can be set through environment variables:

- uses: actions-hub/stylelint@master
  env:
    INDENT_SPACES: 4
    PATTERN: "*.scss"

.stylelintrc

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:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "indentation": 2
  }
}

File pattern

If you want to specify which file or types must be validated.
You need to pass the pattern as a PATTERN variable. By default, it will try to find *.css.

Indentation

Indentation can be set by environment variable INDENT_SPACES.
By default space, indent is 2.

- uses: actions-hub/stylelint@master
  ENV:
    INDENT_SPACES: 4

Example

Default values

name: Test
on: [push]

jobs:
  linters:
    name: stylelint
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions-hub/stylelint@master

Custom paramenters

name: Test
on: [push]

jobs:
  linters:
    name: stylelint
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions-hub/stylelint@master
        env:
          PATTERN: "*.scss"
          INDENT_SPACES: 4

License

MIT License