Skip to content
Open
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions .github/workflows/reusable-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,22 @@ jobs:
NODE_NO_WARNINGS: 1
WASM: 1
run: pnpm run test:ci

### Rsdoctor Diff Action
- name: Clone rspack-sourcemap-demo
run: git clone [email protected]:yifancong/rspack-diff-minimal.git
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git clone command uses SSH protocol ([email protected]:), which will fail in GitHub Actions without SSH key configuration. There's no SSH key setup in the workflow, so this step will fail with an authentication error.

Replace with HTTPS protocol:

run: git clone https://github.com/yifancong/rspack-diff-minimal.git
Suggested change
run: git clone git@github.com:yifancong/rspack-diff-minimal.git
run: git clone https://github.com/yifancong/rspack-diff-minimal.git

Copilot uses AI. Check for mistakes.

- name: Install dependencies
working-directory: rspack-diff-minimal
run: pnpm i

- name: Build project
working-directory: rspack-diff-minimal
run: pnpm run build

- name: Report Compressed Size
uses: web-infra-dev/rsdoctor-action@main
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using @main for the action version is a security and stability risk. The action could change unexpectedly, breaking the workflow or introducing malicious code.

Pin to a specific version or commit SHA:

uses: web-infra-dev/[email protected]  # or specific commit SHA
Suggested change
uses: web-infra-dev/rsdoctor-action@main
uses: web-infra-dev/rsdoctor-action@v1.0.0

Copilot uses AI. Check for mistakes.
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file_path: "rspack-diff-minimal/dist/rsdoctor-data.json"
target_branch: "chore/diff-v2"
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target branch "chore/diff-v2" is hardcoded, which means this workflow will always compare against the same branch regardless of the actual PR base branch. This will produce incorrect comparisons for PRs targeting different branches.

Consider making this configurable or using a dynamic value like ${{ github.base_ref }} to automatically use the PR's target branch.

Suggested change
target_branch: "chore/diff-v2"
target_branch: ${{ github.base_ref }}

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rsdoctor diff steps run unconditionally for all test matrix combinations (different Node versions and targets). This means the same rsdoctor analysis will be executed multiple times unnecessarily, wasting CI resources and potentially causing conflicts.

Add a condition to run only once, for example:

- name: Clone rspack-diff-minimal
  if: ${{ matrix.node == '20' && inputs.target == 'x86_64-unknown-linux-gnu' }}
  run: git clone https://github.com/yifancong/rspack-diff-minimal.git

Apply the same condition to all rsdoctor-related steps (lines 149-162).

Copilot uses AI. Check for mistakes.
Loading