fix(retention): fail-safe on Gitea API errors
- Keep reports when Gitea API returns non-200/non-404 status - Only delete on actual 404 (branch truly doesn't exist) - Log warning for API errors to aid debugging
This commit is contained in:
@@ -33,6 +33,15 @@ branch_exists() {
|
|||||||
BRANCH_CACHE[$key]=1
|
BRANCH_CACHE[$key]=1
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# API error or branch not found - log warning and keep report (fail-safe)
|
||||||
|
if [ "$status" != "404" ]; then
|
||||||
|
echo " WARN: Gitea API error for ${owner}/${repo}/${branch} (status ${status}) - KEEPING report"
|
||||||
|
BRANCH_CACHE[$key]=1 # cache as "exists" to avoid repeated errors
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Actual 404 - branch truly doesn't exist
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user