You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,3 +179,32 @@ By default, files are compared after gzip compression, but it's possible to use
179
179
```yaml
180
180
compression: "none"
181
181
```
182
+
183
+
### Checking multiple bundles
184
+
185
+
The action reuses the same comment each time it runs on a PR. In order to run the action multiple times against separate bundles for a single PR, you must provide a `comment-key` option, which the action will use to determine which comment to add or update for the run. The example below demonstrates this for separate "modern" and "legacy" bundles:
186
+
187
+
```yaml
188
+
name: Compressed Size
189
+
on: [pull_request]
190
+
jobs:
191
+
modern-bundle-size-check:
192
+
runs-on: ubuntu-latest
193
+
steps:
194
+
- uses: actions/checkout@v2
195
+
- uses: preactjs/compressed-size-action@v2
196
+
with:
197
+
build-script: "build:modern"
198
+
comment-key: modern
199
+
200
+
legacy-bundle-size-check:
201
+
runs-on: ubuntu-latest
202
+
steps:
203
+
- uses: actions/checkout@v2
204
+
- uses: preactjs/compressed-size-action@v2
205
+
with:
206
+
build-script: "build:legacy"
207
+
comment-key: legacy
208
+
```
209
+
210
+
If you do not provide this key, the action will attempt to use (and therefore replace) the same comment for both bundles, hiding the output for whichever run finished last.