name: Coding Standards
on:
    pull_request_target:
        branches:
            - master
    push:
        branches:
            - master
        paths-ignore:
            - '**.md'

    # Allows you to run this workflow manually from the Actions tab
    workflow_dispatch:
jobs:
    tag:
        name: Lint and build
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@master
            - name: Setup Node.js
              uses: actions/setup-node@v4
              with:
                node-version: 20
                cache: 'npm'
            - name: NPM config (quieter logs)
              run: |
                  npm config set fund false
                  npm config set audit false
                  npm config set loglevel warn
            - name: Build
              run: |
                  npm ci || npm i
                  npx wp-scripts lint-js
                  npx wp-scripts lint-style
                  npx wp-scripts build
