2022-05-03 21:45:37 +02:00
|
|
|
---
|
|
|
|
name: Lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- 'l10n_master'
|
2022-06-20 21:16:51 +02:00
|
|
|
- 'cf-pages'
|
2022-05-03 21:45:37 +02:00
|
|
|
paths-ignore:
|
|
|
|
- '.github/workflows/**'
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs: {}
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-05-03 21:45:37 +02:00
|
|
|
|
2022-10-18 10:05:33 +02:00
|
|
|
- name: Lint filenames (no capital characters)
|
|
|
|
run: |
|
2022-11-10 15:08:04 +01:00
|
|
|
find . -type f,d -name "*[[:upper:]]*" \
|
2022-10-18 10:05:33 +02:00
|
|
|
! -path "./node_modules/*" \
|
|
|
|
! -path "./coverage/*" \
|
|
|
|
! -path "*/dist/*" \
|
|
|
|
! -path "*/build/*" \
|
|
|
|
! -path "*/target/*" \
|
|
|
|
! -path "./.git/*" \
|
|
|
|
! -path "*/.DS_Store" \
|
2022-11-10 15:08:04 +01:00
|
|
|
! -path "*/*locales/*" \
|
|
|
|
! -path "./.github/*" \
|
2022-10-18 10:05:33 +02:00
|
|
|
> tmp.txt
|
|
|
|
diff <(sort .github/whitelist-capital-letters.txt) <(sort tmp.txt)
|
|
|
|
|
2022-05-03 21:45:37 +02:00
|
|
|
- name: Set up Node
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2022-05-03 21:45:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-05-01 11:09:24 +02:00
|
|
|
node-version: '18'
|
2022-05-03 21:45:37 +02:00
|
|
|
|
|
|
|
- name: Run linter
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run lint
|