-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (44 loc) · 1.33 KB
/
knowledge-validate.yml
File metadata and controls
54 lines (44 loc) · 1.33 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: Knowledge Base Validation
on:
pull_request:
branches: [main]
paths:
- 'knowledge/**'
push:
branches: [main]
paths:
- 'knowledge/**'
jobs:
validate-knowledge:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build scorer package
run: npm run build --workspace=packages/scorer
- name: Validate knowledge schema
run: node scripts/validate-knowledge.js
- name: Generate knowledge index
run: node scripts/generate-knowledge-index.js
- name: Commit index.json if changed
if: github.event_name == 'push' || github.event_name == 'pull_request'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet knowledge/index.json; then
echo "No changes to index.json"
else
git add knowledge/index.json
git commit -m "chore: update knowledge index"
git push
fi
continue-on-error: true