mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
chore: add validation checks for meta.json in CI workflow
This commit is contained in:
19
.github/workflows/validate.yml
vendored
19
.github/workflows/validate.yml
vendored
@@ -53,13 +53,32 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "🔍 Validating meta.json structure and required fields..."
|
echo "🔍 Validating meta.json structure and required fields..."
|
||||||
|
|
||||||
|
# First check if meta.json exists and is valid JSON
|
||||||
|
if [ ! -f "meta.json" ]; then
|
||||||
|
echo "❌ meta.json file not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! jq empty meta.json 2>/dev/null; then
|
||||||
|
echo "❌ meta.json is not a valid JSON file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
ERROR=0
|
ERROR=0
|
||||||
|
|
||||||
|
# Debug: Show total number of entries
|
||||||
|
TOTAL_ENTRIES=$(jq '. | length' meta.json)
|
||||||
|
echo "📊 Total entries in meta.json: $TOTAL_ENTRIES"
|
||||||
|
|
||||||
# Validate JSON structure and required fields
|
# Validate JSON structure and required fields
|
||||||
ENTRIES=$(jq -c '.[]' meta.json)
|
ENTRIES=$(jq -c '.[]' meta.json)
|
||||||
INDEX=0
|
INDEX=0
|
||||||
while IFS= read -r entry; do
|
while IFS= read -r entry; do
|
||||||
((INDEX++))
|
((INDEX++))
|
||||||
|
echo "🔍 Checking entry #$INDEX..."
|
||||||
|
|
||||||
|
# Debug: Show the current entry
|
||||||
|
echo "Current entry: $entry" | jq '.'
|
||||||
|
|
||||||
# Validate required top-level fields
|
# Validate required top-level fields
|
||||||
for field in "id" "name" "version" "description" "logo" "links" "tags"; do
|
for field in "id" "name" "version" "description" "logo" "links" "tags"; do
|
||||||
|
|||||||
Reference in New Issue
Block a user