name: 'Auto analyze if package.json was edited' on: pull_request: branches: - develop permissions: pull-requests: write jobs: auto-analyze: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - name: Check package.json was changed id: changed-file-package-json uses: tj-actions/changed-files@v23 with: sha: ${{ github.event.pull_request.head.sha }} - name: Install node uses: actions/setup-node@v3 if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json') with: node-version: 20 cache: 'npm' - uses: preactjs/compressed-size-action@v2 if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json') with: strip-hash: "\\b\\w{8}\\." pattern: './dist/**/*.{js,css,html,json,woff2,svg,png}' exclude: '{./dist/manifest.json,./dist/build.zip,**/*.map,**/node_modules/**}'