Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
GitHub Action that adds compressed size changes to your PRs.
| Date | Stars |
|---|---|
| 2026-07-24 | 651 |
| 2026-07-25 | 651 |
| 2026-07-28 | 651 |
| 2026-07-30 | 651 |
| 2026-08-06 | 654 |
Today
+3 stars today
This week
+3 stars this week
This month
— stars this month
Momentum
15.0
growth rate 0.46%/day
# compressed-size-action
A GitHub action that reports changes in compressed file sizes on your PRs.
- Automatically uses `yarn`, `pnpm`, `bun`, `deno`, or `npm ci` when lockfiles are present
- Builds your PR, then builds the target and compares between the two
- Doesn't upload anything or rely on centralized storage
- Supports [custom build scripts](#customizing-the-build) and [file patterns](#customizing-the-list-of-files)
<img width="396" src="https://user-images.githubusercontent.com/105127/73027546-a0176a80-3e01-11ea-887b-7326ee289893.png">
<img width="600" src="https://user-images.githubusercontent.com/105127/73027489-8413c900-3e01-11ea-8630-09172b247f82.png">
### Usage:
Add a workflow (`.github/workflows/main.yml`):
```yaml
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
```
> **Note:** Due to GitHub's permission model, this action cannot safely create comments when it is triggered by a PR from a fork. It will, however, still generate the size comparison and print the comment it would've posted to the stdout of the action, allowing manual checking and you can copy/paste it into a comment if you wish.
The markdown comment that `compressed-size-action` posts to pull requests is also exposed as the `comment-body` output. This can be used by later workflow steps to archive the report, pass it to another job, or post the comment from a separate workflow with the permissions you need:
```yaml
- id: compressed-size
uses: preactjs/compressed-size-action@v2
- name: Save compressed size comment
env:
COMMENT_BODY: ${{ steps.compressed-size.outputs.comment-body }}
run: printf '%s\n' "$COMMENT_BODY" > compressed-size-comment.md
```
### Customizing the Installation
By default, `compressed-size-action` will install dependencies according to which lockfiles are present, if any. However, if you need to run a different installation command, you can pass a custom script to do so. For example, to use `npm ci` with the `--workspace` option:
```diff
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
with:
+ install-script: "npm ci --workspace=packages/my-subpackage"
```
### Customizing the Build
By default, `compressed-size-action` will try to build your PR by running the `"build"` [npm script](https://docs.npmjs.com/misc/scripts) in your `package.json`.
If you need to perform some tasks after dependencies are installed but before building, you can use a "postinstall" npm script to do so. For example, in Lerna-based monorepo:
```json
{
"scripts": {
"postinstall": "lerna bootstrap",
"build": "lerna run build"
}
}
```
It is also possible to define a `"prebuild"` npm script, which runs after `"postinstall"` but before `"build"`.
You can also specify a completely different [npm script](https://docs.npmjs.com/misc/scripts) to run instead of the default (`"build"`). To do this, add a **`build-script` option** to your `yml` workflow:
```diff
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
with:
+ build-script: "ci"
```
#### Clean up state between builds
For repositories or custom monorepo setups where files are modified in ways that are not reset by `npm ci && npm run build`, it may be necessary to define a custom "clean" script. This script resets any file modifications after the upstream (`target`) build ends and your PR code (`HEAD`) is checked out, but before installation of npm dependencies for `HEAD`:
```diff
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
with:
Excerpt of 9,063 characters
Read on GitHubJason Miller · @Shopify · Canada
99
16
8
6
fisker Cheung · @d0d0dotcom · China
6
4
3
Michaël De Boey · @BeanCounterBE / @iStart-be · Belgium
3
2
1
1
1
1
1
1
1
1
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:fd0a3655c861be74, topic:workflow