Only load block assets on frontend when block exists. #559
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linting | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - trunk | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| eslint: | |
| name: eslint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup node and npm cache | |
| uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Install Node dependencies | |
| run: npm ci --no-optional | |
| - name: Get updated JS files | |
| id: changed-files | |
| uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1 | |
| with: | |
| files: | | |
| **/*.js | |
| - name: composer install | |
| run: composer install --ignore-platform-reqs | |
| - name: Check PHPCS standard | |
| run: ./vendor/bin/phpcs -i | |
| - name: PHPCS check | |
| id: phpcs | |
| run: ./vendor/bin/phpcs . --runtime-set testVersion 7.4- --report-checkstyle=${RUNNER_TEMP}/phpcs-report.xml | |
| - name: Run JS linting | |
| if: ${{ steps.changed-files.outputs.any_changed == 'true' }} | |
| run: ./node_modules/.bin/10up-toolkit lint-js ${{ steps.changed-files.outputs.all_changed_files }} |