mirror of
https://github.com/tiennm99/composes.git
synced 2026-10-15 22:14:52 +00:00
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.
This commit is contained in:
1 parent
9a9e4cddf7
commit
4576b4dfd5
1 file changed
+2
-2
+2
-2
@@ -43,8 +43,8 @@ echo '{}' > "$WORK/app.json"
|
|||||||
if [ -n "${GITEA_MIRROR_URL:-}" ] && [ -n "${GITEA_MIRROR_API_KEY:-}" ]; then
|
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") \
|
curl -fsS --max-time 60 -H @<(printf 'x-api-key: %s\n' "$GITEA_MIRROR_API_KEY") \
|
||||||
"${GITEA_MIRROR_URL%/}/api/github/repositories" |
|
"${GITEA_MIRROR_URL%/}/api/github/repositories" |
|
||||||
jq '[.repositories[] | select(.mirroredLocation != null and .mirroredLocation != "")
|
jq '[.repositories[]
|
||||||
| {key: (.mirroredLocation | ascii_downcase),
|
| {key: ((if (.mirroredLocation // "") != "" then .mirroredLocation else .fullName end) | ascii_downcase),
|
||||||
value: {id, status, error: ((.errorMessage // "")[0:160])}}] | from_entries' \
|
value: {id, status, error: ((.errorMessage // "")[0:160])}}] | from_entries' \
|
||||||
> "$WORK/app.json"
|
> "$WORK/app.json"
|
||||||
jq -r '" \(length) tracked, \([.[] | select(.status == "failed")] | length) failed"' "$WORK/app.json" >&2
|
jq -r '" \(length) tracked, \([.[] | select(.status == "failed")] | length) failed"' "$WORK/app.json" >&2
|
||||||
|
|||||||
Reference in new issue
Block a user