From 4576b4dfd54592e6d2f759a526ef1157bbed9668 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 3 Oct 2026 13:09:05 +0700 Subject: [PATCH] fix(gitea-mirror): match failed mirrors by source name in detection gitea-mirror clears mirroredLocation when a mirror fails, so failed repos were dropped from the status map and reported as status unknown. --- .../gitea-mirror-maintenance/scripts/detect-failed-mirrors.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitea-mirror/.claude/skills/gitea-mirror-maintenance/scripts/detect-failed-mirrors.sh b/gitea-mirror/.claude/skills/gitea-mirror-maintenance/scripts/detect-failed-mirrors.sh index e7ffff5..26d30fd 100755 --- a/gitea-mirror/.claude/skills/gitea-mirror-maintenance/scripts/detect-failed-mirrors.sh +++ b/gitea-mirror/.claude/skills/gitea-mirror-maintenance/scripts/detect-failed-mirrors.sh @@ -43,8 +43,8 @@ echo '{}' > "$WORK/app.json" if [ -n "${GITEA_MIRROR_URL:-}" ] && [ -n "${GITEA_MIRROR_API_KEY:-}" ]; then curl -fsS --max-time 60 -H @<(printf 'x-api-key: %s\n' "$GITEA_MIRROR_API_KEY") \ "${GITEA_MIRROR_URL%/}/api/github/repositories" | - jq '[.repositories[] | select(.mirroredLocation != null and .mirroredLocation != "") - | {key: (.mirroredLocation | ascii_downcase), + jq '[.repositories[] + | {key: ((if (.mirroredLocation // "") != "" then .mirroredLocation else .fullName end) | ascii_downcase), value: {id, status, error: ((.errorMessage // "")[0:160])}}] | from_entries' \ > "$WORK/app.json" jq -r '" \(length) tracked, \([.[] | select(.status == "failed")] | length) failed"' "$WORK/app.json" >&2