-
Notifications
You must be signed in to change notification settings - Fork 1
Add CI build workflow with file change detection #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stage
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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." | ||
|
Comment on lines
+41
to
+43
|
||
| git --no-pager diff | ||
| git --no-pager diff --stat | ||
| exit 1 | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git status --porcelaincan be non-empty due to untracked files created by the build, butgit diff/git diff --statwon’t show untracked files. This can make CI failures hard to diagnose. Consider also printing thegit status --porcelainoutput (and/or explicitly listing untracked files viagit ls-files -o --exclude-standard) before exiting so the job logs always show what changed.