-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 841 Bytes
/
validate.yml
File metadata and controls
32 lines (30 loc) · 841 Bytes
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
name: validate
on:
pull_request:
paths: ["pkgs/**/*.lua"]
push:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint package descriptors
run: |
fail=0
for f in pkgs/*/*.lua; do
if grep -q "^function install" "$f"; then
echo "::error file=$f::install hook is forbidden"
fail=1
fi
if ! grep -q "mcpp = {" "$f"; then
echo "::error file=$f::missing mcpp = {} segment"
fail=1
fi
if ! grep -q 'schema *= *"0\.1"' "$f"; then
echo "::error file=$f::missing schema = \"0.1\""
fail=1
fi
done
[ $fail -eq 0 ] && echo "All package files valid."
exit $fail