scripts/update_status.py aktualisiert

This commit is contained in:
2026-11-12 13:08:31 +01:00
parent 889617b743
commit ed31a7b824
+26
View File
@@ -217,6 +217,27 @@ def main():
if changed:
print(f'SVG erstellt: {filename}', flush=True)
# Separate Builder status at the top (not included in source totals).
# Optional overrides via sources.json: "builder": {"workflow": "build.yml", "max_age_hours": 26}
builder_cfg = cfg.get('builder', {})
builder_source = {
'owner': builder_cfg.get('owner', OWNER),
'repo': builder_cfg.get('repo', 'vuln-builder'),
'max_age_hours': builder_cfg.get('max_age_hours', cfg.get('max_age_hours', 26)),
}
if builder_cfg.get('workflow'):
builder_source['workflow'] = builder_cfg['workflow']
builder_owner, builder_repo = builder_source['owner'], builder_source['repo']
builder_url = f'{BASE}/{q(builder_owner)}/{q(builder_repo)}'
builder_error = None
try:
_, _, builder_state, builder_success, builder_duration, builder_run = inspect_source(cfg, builder_source)
except Exception as exc:
builder_state = f'{icon_md("error")} API-Fehler'
builder_success = builder_duration = builder_run = '–'
builder_error = f'{builder_repo}: {exc}'
print(f'Builder {builder_repo}: {builder_state.split(" ", 1)[-1]}', flush=True)
counts = dict(total=len(cfg['sources']), success=0, failure=0, running=0,
waiting=0, overdue=0, error=0, unknown=0)
errors, rows = [], []
@@ -242,6 +263,9 @@ def main():
'Automatisch generiertes Dashboard für Gitea Actions.', '',
f'**Letzte Prüfung:** {display_time(NOW)} ',
f'**Überfällig:** Kein erfolgreicher Lauf innerhalb von {cfg.get("max_age_hours", 26)} Stunden (pro Quelle anpassbar).',
'', '## SQLite-Builder', '',
f'**[vuln-builder]({builder_url})** — {builder_state} ',
f'Letzter Erfolg: **{builder_success}** · Laufzeit: **{builder_duration}** · Job: {builder_run}',
'', '## Übersicht', '',
f'- Erfolgreich: **{counts["success"]}**',
f'- Laufend: **{counts["running"]}**',
@@ -266,6 +290,8 @@ def main():
content = '\n'.join(lines)
changed = put_file('README.md', content, 'docs: update vulnerability sync status')
print('README aktualisiert.' if changed else 'README unverändert.', flush=True)
if builder_error:
errors.append(builder_error)
if errors:
for err in errors:
print('ERROR:', err, file=sys.stderr)