Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
github: add stylelint action
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Nov 13, 2023
1 parent daee40d commit 781c7b1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/eslint.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
name: ESLint
name: Linting

on:
push:
branches: [ "main" ]
paths:
- ".github/workflows/eslint.yml"
- "scripts/**"
- "package.json"
- ".eslintrc.js"
pull_request:
branches: [ "main" ]
paths:
- ".github/workflows/eslint.yml"
- "scripts/**"
- "package.json"
- ".eslintrc.js"
schedule:
# Run at 1:45am every Wednesday
- cron: '45 1 * * 3'
Expand Down Expand Up @@ -45,3 +35,28 @@ jobs:
with:
sarif_file: eslint-results.sarif
wait-for-processing: true

stylelint:
name: Run stylelint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install stylelint
run: npm install

- name: Run stylelint
run: npx stylelint **/*.scss
--custom-formatter=node_modules/stylelint-sarif-formatter
-o stylelint-results.sarif
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: stylelint-results.sarif
wait-for-processing: true
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["stylelint-config-standard-scss"]
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
},
"homepage": "https://github.com/adil192/BlackboardTheme#readme",
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"eslint": "^8.53.0",
"@microsoft/eslint-formatter-sarif": "^3.0.0"
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.1.0",
"stylelint-sarif-formatter": "^1.0.7"
}
}

0 comments on commit 781c7b1

Please sign in to comment.