Repository navigation
55 lines (45 loc) · 1.39 KB
/
Copy pathvalidate.yml
File metadata and controls
55 lines (45 loc) · 1.39 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
55
name: Validate Subify
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Clone repository
run: |
git clone --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" repo
- name: Validate manifest
working-directory: repo
run: |
node -e "
const fs = require('fs');
const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf8'));
if (!manifest.name)
throw new Error('manifest.name is missing');
if (!manifest.version)
throw new Error('manifest.version is missing');
console.log('Subify manifest OK');
console.log('Version:', manifest.version);
"
- name: Check required files
working-directory: repo
run: |
test -f manifest.json
test -f README.md
test -f README.En.md
test -f LICENSE
echo "Required files OK"
- name: Check JavaScript syntax
working-directory: repo
run: |
find . -name "*.js" \
-not -path "./.git/*" \
-not -path "./node_modules/*" \
-print0 | while IFS= read -r -d '' file; do
node --check "$file"
done
- name: Validation complete
run: echo "Subify validation passed successfully."