From 64ce22350c5a17b4606697e0e5a36ea31a60b1f2 Mon Sep 17 00:00:00 2001 From: adela Date: Fri, 10 Jan 2025 11:22:17 +0800 Subject: [PATCH] fix --- .github/workflows/bb-export.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bb-export.yml b/.github/workflows/bb-export.yml index b199add..8f53946 100644 --- a/.github/workflows/bb-export.yml +++ b/.github/workflows/bb-export.yml @@ -76,17 +76,8 @@ jobs: return 1 fi - # Validate JSON response - if ! python3 << 'EOF' -import sys, json -try: - with open(sys.argv[1], 'r') as f: - json.load(f) -except json.JSONDecodeError as e: - print(f'Invalid JSON: {str(e)}', file=sys.stderr) - sys.exit(1) -EOF - "$temp_file" 2>/dev/null; then + # Validate JSON response using a simple Python command + if ! python3 -c "import json; json.load(open('$temp_file'))" 2>/dev/null; then echo "Error: Invalid JSON response" rm "$temp_file" return 1