Fix CI: improve security fix and add link checker configuration
- Fix import order (ast before asyncio) - Remove NameError from exception handling (ast.literal_eval doesn't raise it) - Add .lycheeignore to exclude intermittently unavailable star-history API - Update link-check workflow to exclude star-history API and accept 503 status codes
This commit is contained in:
2
.github/workflows/link-check.yml
vendored
2
.github/workflows/link-check.yml
vendored
@@ -14,6 +14,6 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: lycheeverse/lychee-action@v2
|
||||
with:
|
||||
args: --no-progress --insecure --user-agent 'curl/7.68.0' README.md docs/ apps/ examples/ benchmarks/
|
||||
args: --no-progress --insecure --user-agent 'curl/7.68.0' --exclude '.*api\.star-history\.com.*' --accept 200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308,503 README.md docs/ apps/ examples/ benchmarks/
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
5
.lycheeignore
Normal file
5
.lycheeignore
Normal file
@@ -0,0 +1,5 @@
|
||||
# Exclude star-history API from link checking
|
||||
# This service is intermittently unavailable (503 errors)
|
||||
# but the link still works when the service is up
|
||||
.*api\.star-history\.com.*
|
||||
|
||||
@@ -7,10 +7,10 @@ for indexing in LEANN. It supports various Slack MCP server implementations and
|
||||
flexible message processing options.
|
||||
"""
|
||||
|
||||
import ast
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import ast
|
||||
from typing import Any, Optional
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -148,7 +148,7 @@ class SlackMCPReader:
|
||||
if match:
|
||||
try:
|
||||
error_dict = ast.literal_eval(match.group(1))
|
||||
except (ValueError, SyntaxError, NameError):
|
||||
except (ValueError, SyntaxError):
|
||||
pass
|
||||
else:
|
||||
# Try alternative format
|
||||
@@ -156,7 +156,7 @@ class SlackMCPReader:
|
||||
if match:
|
||||
try:
|
||||
error_dict = ast.literal_eval(match.group(1))
|
||||
except (ValueError, SyntaxError, NameError):
|
||||
except (ValueError, SyntaxError):
|
||||
pass
|
||||
|
||||
if self._is_cache_sync_error(error_dict):
|
||||
|
||||
Reference in New Issue
Block a user