-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (43 loc) · 1.34 KB
/
build.yml
File metadata and controls
54 lines (43 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Check npm build
on:
pull_request:
branches:
- main
paths:
- "dist/**"
- "src/**"
- "package.json"
- "package-lock.json"
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read # Only need read access for checking
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.3
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20"
check-latest: true
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
echo "::error::Built files in dist/ are not up to date. Please run 'npm run build' locally and commit the changes."
echo "The following files have changes:"
git status --porcelain dist/
git diff dist/
exit 1
else
echo "✅ Built files are up to date"
fi