Skip to content

Commit fe3d8ce

Browse files
committed
ci: add verify-status sync (regenerate status.json as TechEngineBot)
1 parent 4130783 commit fe3d8ce

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: verify-status
2+
3+
# Keep data/_verify/status.json — the synced aggregate of the verification state
4+
# (how many records are verified + Tier 0 green/yellow/red bands per category) —
5+
# current. Regenerates whenever the dataset changes and daily as a backstop, then
6+
# commits directly as TechEngineBot. The `!data/_verify/**` negation stops its own
7+
# status commit from retriggering the workflow.
8+
on:
9+
push:
10+
branches: [main]
11+
paths:
12+
- "data/**"
13+
- "!data/_verify/**"
14+
schedule:
15+
- cron: "30 5 * * *" # daily 05:30 UTC backstop
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: write
20+
21+
concurrency:
22+
group: verify-status
23+
cancel-in-progress: false
24+
25+
jobs:
26+
status:
27+
runs-on: ubuntu-latest
28+
env:
29+
PYTHONIOENCODING: utf-8
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
token: ${{ secrets.TECHAPI_TOKEN || secrets.GITHUB_TOKEN }}
34+
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.12"
38+
39+
- name: Regenerate verification status aggregate
40+
run: python -m app.verify status --output data/_verify/status.json
41+
42+
- name: Commit if changed (TechEngineBot)
43+
run: |
44+
if git diff --quiet -- data/_verify/status.json; then
45+
echo "verification status unchanged"; exit 0
46+
fi
47+
# Attribute the commit to the TechEngineBot account (id 289859915).
48+
git config user.name "TechEngineBot"
49+
git config user.email "289859915+TechEngineBot@users.noreply.github.com"
50+
git add data/_verify/status.json
51+
git commit -m "chore(verify): refresh verification status aggregate"
52+
git push origin HEAD:main

0 commit comments

Comments
 (0)