Only lint changed SVG icons on CI (#10602)

This commit is contained in:
Álvaro Mondéjar 2024-03-09 17:36:18 +01:00 committed by GitHub
parent 6dca3fb56b
commit 2bcda1dd33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 10 deletions

View File

@ -30,14 +30,7 @@ jobs:
node-version: 20
cache: npm
cache-dependency-path: '**/package.json'
- name: Install dependencies
run: npm i
- name: Run linter
run: npm run lint
env:
# Authorise GitHub API requests for editorconfig-checker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Detect changed documentation files
- name: Detect changed files
uses: dorny/paths-filter@v3
id: changes
with:
@ -46,8 +39,18 @@ jobs:
docs:
- '*.md'
- '.github/**.md'
icons:
- 'icons/*.svg'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm i
- name: Run linter
run: npm run lint --icons='${{ steps.changes.outputs.icons_files }}'
env:
# Authorise GitHub API requests for editorconfig-checker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check documentation links
if: steps.changes.outputs.docs == 'true'
if: steps.changes.outputs.docs == true
run: |
npx markdown-link-check --retry \
--config .github/markdown-link-check.json \

3
.npmrc
View File

@ -1,2 +1,5 @@
package-lock=false
save-exact=true
# Icons to lint with SVGLint (see `npm run svglint`)
icons=icons/*.svg

View File

@ -116,7 +116,7 @@
"our-lint": "node scripts/lint/ourlint.js",
"jslint": "prettier --cache --check .",
"jsonlint": "node scripts/lint/jsonlint.js",
"svglint": "svglint icons/*.svg --ci",
"svglint": "svglint --ci $npm_config_icons",
"wslint": "editorconfig-checker",
"prepare": "is-ci || husky",
"prepublishOnly": "npm run build",