https://github.com/reload/action-style-quality
https://github.com/reload/action-style-quality
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/reload/action-style-quality
- Owner: reload
- Created: 2021-11-09T13:10:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-03-17T10:23:52.000Z (5 months ago)
- Last Synced: 2026-03-18T01:28:04.311Z (5 months ago)
- Size: 120 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# action-style-quality
GitHub action that yells if style formatting and linting is not up to snuff!
# Requirements
[npm >= 7](https://github.blog/2021-02-02-npm-7-is-now-generally-available/)
Install the minimally required packages:
```sh
npm install stylelint prettier --save-dev
```
The action will make use of your installed version of the required tools.
So make sure to have them specified in your `package.json` and available from
`node_modules/.bin`
# Usage
## Root configuration
```yaml
name: Style Quality
on: pull_request
jobs:
quality:
name: Style Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Style Quality
uses: reload/action-style-quality@1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
## Subdirectory (theme) configuration
```yaml
name: Style Quality
on: pull_request
jobs:
quality:
name: Style Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: ./web/themes/custom/custom-theme/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: ./web/themes/custom/custom-theme
- name: Style Quality
uses: reload/action-style-quality@1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
working_directory: ./web/themes/custom/custom-theme/scss
```
## Change targeted files
```yaml
jobs:
quality:
name: Style Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Style Quality
uses: reload/action-style-quality@1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file_extensions: '.css,' # Default: '.css,.sass,.scss,.less'
```
## Override stylelint and prettier targets
```yaml
jobs:
quality:
name: Style Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Style Quality
uses: reload/action-style-quality@1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Both of the specified targets have their origin at whatever
# 'working_directory' is set to.
working_directory: './src' # Default: ''
prettier_target: './code/**/*' # Default: './**/*'
stylelint_target: './code/**/*' # Default: './**/*'
```