Added wiki generator

This commit is contained in:
AB from home.homenet
2025-09-16 16:13:26 +03:00
parent eb3b5183b0
commit 9dd761bc8e

View File

@@ -66,7 +66,7 @@ jobs:
echo "🔍 Validating and extracting JSON..."
if python3 -c "import json; f=open('terraform-output.json'); data=json.load(f); f.close(); print('✅ Valid JSON')" 2>/dev/null; then
# Extract just the value field using Python (more reliable than jq)
python3 -c "
cat > extract_value.py << 'EOF'
import json
with open('terraform-output.json', 'r') as f:
data = json.load(f)
@@ -77,13 +77,14 @@ with open('terraform-output.json', 'r') as f:
value = data
with open('terraform-output-value.json', 'w') as out:
json.dump(value, out, indent=2)
"
EOF
python3 extract_value.py
mv terraform-output-value.json terraform-output.json
echo "✅ JSON extracted successfully"
else
echo "❌ Invalid JSON detected, trying to fix..."
# Try to extract valid JSON part
python3 -c "
cat > fix_json.py << 'EOF'
import json
import re
@@ -121,7 +122,8 @@ try:
print('❌ No JSON found in output')
except Exception as e:
print(f'❌ Failed to fix JSON: {e}')
"
EOF
python3 fix_json.py
fi
# Debug output