Skip to content

Commit d371d55

Browse files
committed
ci: status.json sync in TechEngine (bot commit to TechAPI)
1 parent bf0081d commit d371d55

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: verify-status
2+
3+
# Keep TechAPI's data/_verify/status.json (the verification-state aggregate: how
4+
# many records are verified + Tier 0 bands per category) current. Runs in
5+
# TechEngine against a TechAPI checkout and commits the refreshed file back to
6+
# TechAPI main as TechEngineBot. Fires when TechAPI main changes (relayed by
7+
# TechAPI's notify-engine -> techapi-updated) and daily as a backstop. The
8+
# "commit only if changed" guard means the status commit can't loop.
9+
on:
10+
repository_dispatch:
11+
types: [techapi-updated]
12+
schedule:
13+
- cron: "30 5 * * *" # daily 05:30 UTC backstop
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: verify-status
21+
cancel-in-progress: false
22+
23+
jobs:
24+
status:
25+
runs-on: ubuntu-latest
26+
env:
27+
PYTHONIOENCODING: utf-8
28+
TECHAPI_DATA_DIR: ${{ github.workspace }}/TechAPI/data
29+
steps:
30+
- name: Checkout TechEngine
31+
uses: actions/checkout@v4
32+
33+
- name: Checkout TechAPI
34+
uses: actions/checkout@v4
35+
with:
36+
repository: GetTechAPI/TechAPI
37+
path: TechAPI
38+
token: ${{ secrets.TECHENGINEBOT_TOKEN || secrets.TECHAPI_TOKEN || secrets.GITHUB_TOKEN }}
39+
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: "3.12"
43+
cache: pip
44+
45+
- name: Install TechEngine
46+
run: pip install -e .
47+
48+
- name: Regenerate verification status aggregate
49+
run: python -m app.verify status --output TechAPI/data/_verify/status.json
50+
51+
- name: Commit to TechAPI if changed (TechEngineBot)
52+
run: |
53+
cd TechAPI
54+
git add data/_verify/status.json
55+
if git diff --cached --quiet; then
56+
echo "verification status unchanged"; exit 0
57+
fi
58+
git config user.name "TechEngineBot"
59+
git config user.email "289859915+TechEngineBot@users.noreply.github.com"
60+
git commit -m "chore(verify): refresh verification status aggregate"
61+
git push origin HEAD:main

0 commit comments

Comments
 (0)