1
0
This commit is contained in:
Ö. Efe D.
2025-01-01 17:46:37 +01:00
parent be752901cf
commit ced1a3e0a0
3 changed files with 168 additions and 0 deletions

44
.github/workflows/check-mod.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Validate Balatro Mods
on:
pull_request:
paths:
- "mods/**"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Check Required Files
run: |
# This for-loop iterates over each directory in mods/
# to ensure description.md and meta.json exist.
for dir in mods/*/; do
MOD_DIR="$(basename "$dir")"
if [ ! -f "$dir/description.md" ]; then
echo "Error: Missing description.md in $MOD_DIR"
exit 1
fi
if [ ! -f "$dir/meta.json" ]; then
echo "Error: Missing meta.json in $MOD_DIR"
exit 1
fi
done
- name: Validate JSON Format
uses: github/super-linter@v4
env:
VALIDATE_JSON: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Meta.json Against Schema
uses: ajv-validator/ajv-cli-action@v1
with:
schema: "./schema/meta.schema.json"
files: "mods/*/meta.json"

View File

@@ -0,0 +1,31 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Balatro Mod Metadata",
"type": "object",
"properties": {
"title": {
"type": "string"
},
"mod-loader": {
"type": "string",
"enum": ["steamodded", "balamod"]
},
"category": {
"type": "string",
"enum": ["Gameplay", "UI", "Card Mods"]
},
"author": {
"type": "string"
},
"repo": {
"type": "string",
"format": "uri"
},
"downloadURL": {
"type": "string",
"format": "uri"
}
},
"required": ["title", "mod-loader", "category", "author", "repo", "downloadURL"]
}