-
-
Notifications
You must be signed in to change notification settings - Fork 378
38 lines (32 loc) · 1.07 KB
/
auto-analyze.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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@v41
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Install node
uses: actions/setup-node@v4
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/**}'