Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'

# Update npm to the latest version to enable OIDC
Expand Down Expand Up @@ -71,6 +71,8 @@ jobs:

- name: Report Compressed Size
uses: ./
env:
AI_TOKEN: ${{ secrets.AI_TOKEN }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file_path: 'examples/**/*/.rsdoctor/rsdoctor-data.json'
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default defineConfig({
| `file_path` | Path to Rsdoctor JSON data file | Yes | - |
| `target_branch` | Target branch for baseline comparison | No | `main` |

> AI-assisted analysis reads `AI_TOKEN` from the action step environment. Store it as a GitHub Actions secret in repository settings, then pass it to the step with `AI_TOKEN: ${{ secrets.AI_TOKEN }}`.

- `target_branch`: If you want to use a dynamic target branch (e.g., the PR base branch instead of a fixed main), use:
`target_branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }}`

Expand Down Expand Up @@ -137,6 +139,8 @@ jobs:

- name: Bundle Analysis
uses: web-infra-dev/rsdoctor-action@main
env:
AI_TOKEN: ${{ secrets.AI_TOKEN }}
with:
file_path: 'dist/.rsdoctor/rsdoctor-data.json'
target_branch: 'main'
Expand Down Expand Up @@ -217,4 +221,4 @@ pnpm run build
cd examples/rsbuild-demo
pnpm install
pnpm run build
```
```
11 changes: 8 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: '@yifancong/bundle-action'
description: 'A simple demo for checking compressed size differences'
description: 'A simple demo for checking compressed size differences. Requires the AI_TOKEN secret for AI-assisted analysis.'
branding:
icon: 'archive'
color: 'purple'
Expand All @@ -20,7 +20,12 @@ inputs:
required: false
default: ''
type: string
ai_model:
description: 'AI model to use for degradation analysis (e.g. claude-3-5-haiku-latest, gpt-4o-mini). Provider is auto-detected from the model name prefix. Set AI_TOKEN as a GitHub Actions secret and pass it to the action step for AI-assisted analysis.'
required: false
default: 'claude-3-5-haiku-latest'
Comment thread
yifancong marked this conversation as resolved.
type: string

runs:
using: 'node20'
main: 'dist/index.js'
using: 'node24'
main: 'dist/index.js'
424 changes: 424 additions & 0 deletions dist/682.js

Large diffs are not rendered by default.

380 changes: 380 additions & 0 deletions dist/749.js

Large diffs are not rendered by default.

32,856 changes: 32,505 additions & 351 deletions dist/index.js

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@
"access": "public"
},
"devDependencies": {
"@ai-sdk/anthropic": "^3.0.69",
"@ai-sdk/deepseek": "^2.0.29",
"@ai-sdk/google": "^3.0.63",
"@ai-sdk/openai": "^3.0.52",
"ai": "^6.0.159",
"@actions/artifact": "^2.3.2",
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@playwright/test": "^1.42.1",
"@rsdoctor/cli": "1.3.3-beta.2",
"@rsdoctor/client": "1.3.3-beta.2",
"@rsdoctor/cli": "1.5.8",
"@rsdoctor/client": "1.5.8",
"@rslib/core": "^0.16.0",
"@rstest/core": "^0.5.4",
"@types/node": "^24.5.2",
Expand All @@ -53,6 +58,7 @@
"yauzl": "^3.2.0"
},
"overrides": {
"@rsdoctor/client": "1.3.3-beta.2"
}
"@rsdoctor/client": "1.5.8"
},
"packageManager": "pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531"
}
Loading
Loading