#!/usr/bin/env python3 """Read-only inventory for Gitea workflow runner labels. The script never prints credentials. It reads workflow files from Gitea when GITEA_BASE/GITEA_USER/GITEA_TOKEN are available, or derives them from the current repository's `gitea` remote when that remote embeds basic auth. Example: ops/runner/audit-workflow-labels.py \ --local-repo wooo/stockplatform-v2=/Users/ogt/stockplatform-v2 """ from __future__ import annotations import argparse import base64 import json import re import subprocess import sys import urllib.error import urllib.request from dataclasses import dataclass from pathlib import Path from typing import Iterable DEFAULT_REPOS = ("wooo/awoooi", "wooo/ewoooc", "wooo/stockplatform-v2") WORKFLOW_DIRS = (".gitea/workflows",) RUNS_ON_RE = re.compile(r"^\s*runs-on:\s*(?P