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
|
2024-02-08 21:56:39 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-05-03 21:45:37 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
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)
|
|
|
|
|
2023-10-04 18:23:40 +02:00
|
|
|
- name: Get Node Version
|
|
|
|
id: retrieve-node-version
|
|
|
|
run: |
|
|
|
|
NODE_NVMRC=$(cat .nvmrc)
|
|
|
|
NODE_VERSION=${NODE_NVMRC/v/''}
|
|
|
|
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-05-03 21:45:37 +02:00
|
|
|
- name: Set up Node
|
2024-02-08 21:29:48 +01:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2022-05-03 21:45:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
2022-05-03 21:45:37 +02:00
|
|
|
|
|
|
|
- name: Run linter
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run lint
|