Skip to content

Commit 2e47ce8

Browse files
committed
ci: add github actions to check dist folder
1 parent 5a595fd commit 2e47ce8

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/code_health.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Code Health
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
13+
with:
14+
config: ${{ vars.PERMISSIONS_CONFIG }}
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version-file: package.json
20+
- name: install dependencies
21+
run: |
22+
npm ci
23+
- name: build
24+
run: |
25+
npm run build
26+
- name: Check for uncommitted files
27+
run: |
28+
export FILES=
29+
FILES=$(git ls-files -o -m --directory --exclude-standard --no-empty-directory)
30+
export LINES=
31+
LINES=$(echo "$FILES" | awk 'NF' | wc -l)
32+
if [ "$LINES" -ne 0 ]; then
33+
echo "Detected files that need to be committed:"
34+
echo "${FILES//^/ }"
35+
echo ""
36+
echo "Try running: npm run build"
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)