Skip to content

Commit e6e7d1f

Browse files
committed
package lock check
1 parent 3b8a691 commit e6e7d1f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Package Lock File
2+
3+
concurrency:
4+
group: check-package-lock-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- "**" # Run on push to any branch
11+
pull_request:
12+
branches:
13+
- "**" # Run on PR to any branch
14+
15+
jobs:
16+
verify-package-lock:
17+
name: Verify package-lock.json exists
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Check if package-lock.json exists
26+
run: |
27+
if [ ! -f "package-lock.json" ]; then
28+
echo "ERROR: package-lock.json file is missing from the repository"
29+
echo "This file is required to ensure consistent dependency versions across all environments"
30+
echo "Please ensure package-lock.json is committed with your changes"
31+
exit 1
32+
fi
33+
echo "SUCCESS: package-lock.json file is present"
34+
35+
- name: Verify package-lock.json is not empty
36+
run: |
37+
if [ ! -s "package-lock.json" ]; then
38+
echo "ERROR: package-lock.json file exists but is empty"
39+
echo "Please run 'npm install' to regenerate the lock file"
40+
exit 1
41+
fi
42+
echo "SUCCESS: package-lock.json file is valid and not empty"

0 commit comments

Comments
 (0)