Skip to content
Open
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
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build

on:
pull_request:
branches:
- main
- stage
push:
branches:
- main
- stage

permissions:
contents: read

jobs:
build:
name: Build packages
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14.0"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Check for file changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Build generated file changes that are not committed. Please build locally and commit the changes."
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

git status --porcelain can be non-empty due to untracked files created by the build, but git diff/git diff --stat won’t show untracked files. This can make CI failures hard to diagnose. Consider also printing the git status --porcelain output (and/or explicitly listing untracked files via git ls-files -o --exclude-standard) before exiting so the job logs always show what changed.

Suggested change
echo "::error::Build generated file changes that are not committed. Please build locally and commit the changes."
echo "::error::Build generated file changes that are not committed. Please build locally and commit the changes."
echo "git status --porcelain output:"
git status --porcelain
echo "Untracked files (if any):"
git ls-files -o --exclude-standard || true

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +43
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The PR description says this workflow verifies that no tracked files were modified by the build, but git status --porcelain will also fail the job if the build creates any non-ignored untracked files. If the intent is tracked-only, consider using git diff --exit-code (and possibly --stat) or git status --porcelain --untracked-files=no; otherwise, update the description/step naming to reflect the stricter behavior.

Copilot uses AI. Check for mistakes.
git --no-pager diff
git --no-pager diff --stat
exit 1
fi
Loading