Skip to content

Commit 3fa9767

Browse files
alekswebnetclaude
andcommitted
Add a build check for pull requests
The deploy workflow only runs on pushes to main, so a pull request got no build status and a broken build showed up only after merging. A separate Build workflow now runs `pnpm build` on every pull request, with a read-only token. pages.yml is unchanged, so deploys keep their own permissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent cd1ebe5 commit 3fa9767

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

‎.github/workflows/build.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Builds pull requests so a broken build shows up before merging.
2+
# Deploys stay in pages.yml, which runs on pushes to main.
3+
name: Build
4+
5+
on:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: build-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v7
20+
- uses: pnpm/action-setup@v6
21+
- uses: actions/setup-node@v7
22+
with:
23+
node-version: 24
24+
cache: pnpm
25+
- run: pnpm install --frozen-lockfile
26+
- run: pnpm build

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pnpm dev # http://localhost:8080
1717
pnpm build # writes _site/
1818
```
1919

20-
Pushes to `main` deploy through [.github/workflows/pages.yml](.github/workflows/pages.yml).
20+
Pushes to `main` deploy through [.github/workflows/pages.yml](.github/workflows/pages.yml). Pull requests get a build check from [.github/workflows/build.yml](.github/workflows/build.yml).
2121

2222
## Editing the pdfjs-viewer docs
2323

0 commit comments

Comments
 (0)