name: Compressed Size

on:
  pull_request:
    branches:
      - develop
      - master
    types:
      - opened
      - reopened
      - synchronize
    paths:
      - 'assets/js/**.js'
      - '!assets/js/**.test.js'
      - '!assets/js/**/test/**'
      - 'assets/sass/**/*.scss'
      - 'assets/svg/**/*.svg'
      - './*.config.js'
      - './package-lock.json'

jobs:
  build:
    name: Check
    runs-on: ubuntu-latest
    if: github.event.pull_request.draft == false
    steps:
      - uses: preactjs/compressed-size-action@v2
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          pattern: "./dist/assets/**/*.{css,js}"
          # The sub-match below will be replaced by asterisks.
          # The length of 20 corresponds to webpack's `output.hashDigestLength`.
          strip-hash: "\\.([a-f0-9]{20})\\.(?:css|js)$"

name: Compressed Size

on:
  pull_request:
    branches:
      - develop
      - master
    types:
      - opened
      - reopened
      - synchronize
    paths:
      - 'assets/js/**.js'
      - '!assets/js/**.test.js'
      - '!assets/js/**/test/**'
      - 'assets/sass/**/*.scss'
      - 'assets/svg/**/*.svg'
      - './*.config.js'
      - './package-lock.json'

jobs:
  build:
    name: Check
    runs-on: ubuntu-latest
    if: github.event.pull_request.draft == false
    steps:
      - uses: actions/checkout@v2
      - name: Read .nvmrc
        run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
        id: nvm
      - name: Setup Node.js (.nvmrc)
        uses: actions/setup-node@v1
        with:
          node-version: "${{ steps.nvm.outputs.NVMRC }}"
      - name: Cache Node - npm
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-cache-
      - uses: preactjs/compressed-size-action@v2
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          pattern: "./dist/assets/**/*.{css,js}"
          # The sub-match below will be replaced by asterisks.
          # The length of 20 corresponds to webpack's `output.hashDigestLength`.
          strip-hash: "\\.([a-f0-9]{20})\\.(?:css|js)$"

Add checkout and node setup steps.
Add checkout and node setup steps.
