-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (33 loc) · 1.02 KB
/
quality.yml
File metadata and controls
42 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Code Quality Checks
on: [push, pull_request]
permissions:
contents: write
pull-requests: write
jobs:
lint:
name: Run Linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Initialize project and install dependencies
run: |
npm init -y
npm install htmlhint stylelint stylelint-config-standard --save-dev
# Run HTMLHint (no autofix)
- name: Run HTMLHint
run: npx htmlhint "**/*.html" --config .htmlhintrc || true
# Create default stylelint config if missing
- name: Create default .stylelintrc.json
run: |
echo '{
"extends": "stylelint-config-standard"
}' > .stylelintrc.json
if: ${{ !hashFiles('.stylelintrc.json') }}
# Run stylelint with autofix
- name: Run Stylelint with Autofix
run: npx stylelint "**/*.css" --fix