name: Lint

on:
  pull_request:
    types: [closed]
    branches: [main]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Setup Node.js
        uses: actions/setup-node@v2.4.0
        with:
          node-version: '16.x'
      - name: Install dependencies
        run: npm install
      - name: Lint CSS files
        run: npx stylelint '**/*.css' --config .stylelintrc.json
      - name: Lint JavaScript files
        run: npx eslint '**/*.js'
      - name: Lint HTML files
        run: npx htmlhint '**/*.html'

