-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 3 KB
/
Copy pathprogram-fact-refresh.yml
File metadata and controls
95 lines (83 loc) · 3 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Weekly official program fact refresh
on:
schedule:
- cron: '19 4 * * 2'
workflow_dispatch:
inputs:
maximum_urls:
description: Maximum current Catalog official URLs to inspect (0 means all)
required: false
default: '1000'
permissions:
contents: write
concurrency:
group: weekly-program-fact-refresh
cancel-in-progress: false
jobs:
refresh:
name: Refresh grounded program facts
runs-on: ubuntu-latest
timeout-minutes: 180
env:
CI: 'true'
NEXT_TELEMETRY_DISABLED: '1'
steps:
- name: Check out main
uses: actions/checkout@v6
with:
ref: main
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Install PDF text extraction
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends poppler-utils
- name: Set refresh date
id: date
shell: bash
run: echo "value=$(date -u +%F)" >> "$GITHUB_OUTPUT"
- name: Build complete current Catalog review queue
shell: bash
run: |
npx tsx scripts/ingestion/build-current-program-review.ts \
--data-dir content/data \
--output "$RUNNER_TEMP/current-program-review.json" \
--generated-at "${{ steps.date.outputs.value }}T00:00:00.000Z"
- name: Refresh official facts
shell: bash
env:
MAXIMUM_URLS: ${{ inputs.maximum_urls || '1000' }}
run: |
npx tsx scripts/ingestion/enrich-international-program-facts.ts \
--review "$RUNNER_TEMP/current-program-review.json" \
--data-dir content/data \
--output-dir content/data \
--audit "quality/international-program-review/fact-enrichment-${{ steps.date.outputs.value }}.json" \
--checked-at "${{ steps.date.outputs.value }}" \
--max-urls "$MAXIMUM_URLS" \
--minimum-domain-interval-ms 5000
- name: Validate refreshed Catalog
run: |
npm run validate:data
npx vitest run \
tests/unit/international-program-fact-enrichment.test.ts \
tests/unit/content-data.test.ts \
tests/unit/publication.test.ts
- name: Commit verified changes
shell: bash
run: |
if git diff --quiet -- content/data quality/international-program-review; then
echo "No verified fact changes."
exit 0
fi
git config user.name "studyinchina-data-bot"
git config user.email "studyinchina-data-bot@users.noreply.github.com"
git add content/data/programs.json content/data/admission-cycles.json \
"quality/international-program-review/fact-enrichment-${{ steps.date.outputs.value }}.json"
git commit -m "data: refresh official program facts ${{ steps.date.outputs.value }}"
git push origin HEAD:main