1
0

Compare commits

...

15 Commits

Author SHA1 Message Date
Ö. Efe D.
a7d8a0ba0b remove temp upstream first when cloning
Some checks failed
fetch upstream mod changes / replace-mods (push) Failing after 18s
2025-12-24 03:08:23 +01:00
Ö. Efe D.
5923ab136c Remove install deps 2025-12-24 03:06:35 +01:00
Ö. Efe D.
9ebb8f16e6 Only use correct runners on Gitea 2025-12-24 02:57:10 +01:00
Ö. Efe D.
67f4d4ac62 Add upstream sync workflow (Gitea) 2025-12-24 02:49:33 +01:00
Ö. Efe D.
a0507b1723 Enable Git LFS for mods (Gitea only) 2025-12-24 02:48:37 +01:00
Version Update Bot
b7109e4a30 Auto-update mod versions (2025-12-24 01:26:50)
Updated mods:
- Pokermon-Maelmc: c308110 → 3ae8967 (VersionSource.HEAD)
- Bakery: 05faca8 → 2d57d0e (VersionSource.HEAD)
2025-12-24 01:26:50 +00:00
Version Update Bot
452c01e520 Auto-update mod versions (2025-12-23 23:18:25)
Updated mods:
- Pokermon: 332c9e0 → dbb3302 (VersionSource.HEAD)
2025-12-23 23:18:26 +00:00
Version Update Bot
58979a2035 Auto-update mod versions (2025-12-23 22:19:31)
Updated mods:
- Pokermon+: fe6cf61 → 7be47aa (VersionSource.HEAD)
2025-12-23 22:19:31 +00:00
Version Update Bot
ea4af455b6 Auto-update mod versions (2025-12-23 21:18:31)
Updated mods:
- Pokermon-Maelmc: be94838 → c308110 (VersionSource.HEAD)
2025-12-23 21:18:31 +00:00
Version Update Bot
09d0c722a5 Auto-update mod versions (2025-12-23 18:29:59)
Updated mods:
- Greener Jokers: a4a73ab → c1ae91c (VersionSource.HEAD)
- Pokermon-Maelmc: cbacdb6 → be94838 (VersionSource.HEAD)
- Pokermon: 7900bd5 → 332c9e0 (VersionSource.HEAD)
2025-12-23 18:29:59 +00:00
Version Update Bot
85603e537e Auto-update mod versions (2025-12-23 16:26:15)
Updated mods:
- Nacho's Pokermon Dip: 3b57138 → 991c6e3 (VersionSource.HEAD)
2025-12-23 16:26:16 +00:00
Version Update Bot
8221a7fd17 Auto-update mod versions (2025-12-23 15:21:14)
Updated mods:
- Pokermon-Maelmc: 4dcd6fd → cbacdb6 (VersionSource.HEAD)
2025-12-23 15:21:14 +00:00
Version Update Bot
e36d3cf5bc Auto-update mod versions (2025-12-23 14:19:51)
Updated mods:
- The Toxic Stall: A Pokermon addon: ac50d66 → 3d197dd (VersionSource.HEAD)
2025-12-23 14:19:51 +00:00
Version Update Bot
7faaaefaa3 Auto-update mod versions (2025-12-23 09:24:50)
Updated mods:
- Regals Mod: 70888c0 → 2964001 (VersionSource.HEAD)
- Azazel's Jokers: v2.0.1 → v2.0.3 (VersionSource.LATEST_TAG)
2025-12-23 09:24:50 +00:00
Version Update Bot
68d3ba9ce0 Auto-update mod versions (2025-12-23 06:32:28)
Updated mods:
- Agarmons: A Pokermon Addon: 1274a77 → 6ec6e12 (VersionSource.HEAD)
2025-12-23 06:32:28 +00:00
14 changed files with 66 additions and 222 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
mods/** filter=lfs diff=lfs merge=lfs -text

View File

@@ -1,151 +0,0 @@
name: Validate Balatro Mods
on:
pull_request:
paths:
- "mods/**"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Get full history for comparing changes
- name: Use ImageMagick from cache
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: imagemagick
version: 8:6.9.12.98+dfsg1-5.2build2
- name: Identify Changed Mods
id: find-changed-mods
run: |
# Get the list of files changed in the PR using GitHub API
API_RESPONSE=$(curl -s -X GET \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files")
# Use fallback method if API fails
if echo "$API_RESPONSE" | jq -e 'if type=="array" then true else false end' > /dev/null; then
echo "Using GitHub API method to find changed files"
echo "$API_RESPONSE" | jq -r '.[] | .filename' | grep -E '^mods/[^/]+/' | cut -d'/' -f1-2 | sort | uniq > changed_mods.txt
else
echo "Using git diff method as fallback"
# Fetch the base branch of the PR
git fetch origin ${{ github.event.pull_request.base.ref }}
# Find all added or modified files in mods directory using git diff
git diff --name-only --diff-filter=AM origin/${{ github.event.pull_request.base.ref }}..HEAD | grep -E '^mods/[^/]+/' | cut -d'/' -f1-2 | sort | uniq > changed_mods.txt
fi
# Check if any mods were found
if [ ! -s changed_mods.txt ]; then
echo "No mods were added or modified in this PR."
echo "changed_mods_found=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "Changed mods found:"
cat changed_mods.txt
echo "changed_mods_found=true" >> $GITHUB_OUTPUT
# Create a newline-separated list for JSON schema validation
META_JSON_FILES=$(while read -r mod_path; do
[ -f "$mod_path/meta.json" ] && echo "$mod_path/meta.json"
done < changed_mods.txt)
echo "meta_json_files<<EOF" >> $GITHUB_OUTPUT
echo "$META_JSON_FILES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Check Required Files
if: steps.find-changed-mods.outputs.changed_mods_found == 'true'
run: |
while read -r mod_path; do
if [ -d "$mod_path" ]; then
MOD_DIR="$(basename "$mod_path")"
# Ensure description.md and meta.json exist
if [ ! -f "$mod_path/description.md" ]; then
echo "Error: Missing description.md in $MOD_DIR"
exit 1
fi
if [ ! -f "$mod_path/meta.json" ]; then
echo "Error: Missing meta.json in $MOD_DIR"
exit 1
fi
fi
done < changed_mods.txt
- name: Check Thumbnail Dimensions
if: always() && steps.find-changed-mods.outputs.changed_mods_found == 'true'
run: |
while read -r mod_path; do
if [ -d "$mod_path" ]; then
MOD_DIR="$(basename "$mod_path")"
THUMBNAIL="$mod_path/thumbnail.jpg"
if [ -f "$THUMBNAIL" ]; then
# Extract width and height using ImageMagick identify
# Using identify-im6.q16 directly as identify is a symlink that is not created by the cache restoration
DIMENSIONS=$(/usr/bin/identify-im6.q16 -format "%wx%h" "$THUMBNAIL")
WIDTH=$(echo "$DIMENSIONS" | cut -dx -f1)
HEIGHT=$(echo "$DIMENSIONS" | cut -dx -f2)
# Check if dimensions exceed 1920x1080
if [ "$WIDTH" -gt 1920 ] || [ "$HEIGHT" -gt 1080 ]; then
echo "Error: Thumbnail in $MOD_DIR exceeds the recommended size of 1920×1080."
exit 1
fi
fi
fi
done < changed_mods.txt
- name: Validate JSON Format
if: always() && steps.find-changed-mods.outputs.changed_mods_found == 'true'
run: |
# Use jq to validate each JSON file
while read -r mod_path; do
if [ -f "$mod_path/meta.json" ]; then
if ! jq empty "$mod_path/meta.json" 2>/dev/null; then
echo "Error: Invalid JSON format in $mod_path/meta.json"
exit 1
fi
fi
done < changed_mods.txt
- name: Validate meta.json Against Schema
if: always() && steps.find-changed-mods.outputs.changed_mods_found == 'true'
uses: dsanders11/json-schema-validate-action@v1.4.0
with:
schema: "./schema/meta.schema.json"
files: ${{ steps.find-changed-mods.outputs.meta_json_files }}
custom-errors: true
- name: Validate Download URLs
if: always() && steps.find-changed-mods.outputs.changed_mods_found == 'true'
run: |
while read -r mod_path; do
if [ -d "$mod_path" ]; then
MOD_DIR="$(basename "$mod_path")"
META_JSON="$mod_path/meta.json"
# Check if downloadURL exists and is not empty
DOWNLOAD_URL=$(jq -r '.downloadURL // empty' "$META_JSON")
if [ -z "$DOWNLOAD_URL" ]; then
echo "Error: Missing or empty downloadURL in $MOD_DIR/meta.json"
exit 1
fi
# Optional: Check if URL is accessible
if ! curl --output /dev/null --silent --head --fail "$DOWNLOAD_URL"; then
echo "Error: downloadURL in $MOD_DIR/meta.json is not accessible"
exit 1
fi
fi
done < changed_mods.txt

View File

@@ -0,0 +1,44 @@
name: fetch upstream mod changes
on:
schedule:
- cron: '13,43 * * * *'
workflow_dispatch:
jobs:
replace-mods:
runs-on: ubuntu-latest
steps:
- name: Checkout current Gitea repo
uses: actions/checkout@v4
with:
lfs: true
- name: Clone upstream GitHub repo
run: |
rm -rf /tmp/upstream
git clone https://github.com/skyline69/balatro-mod-index.git /tmp/upstream
- name: Replace mods directory
run: |
rm -rf mods
cp -a /tmp/upstream/mods ./mods
- name: Append last-updated timestamp
run: |
TIME_NOW=$(date +"%s")
git diff -z --name-only | grep -z meta.json | while IFS='' read -r -d '' file; do
jq --indent 2 '."last-updated" |= (. // '"$TIME_NOW"')' "$file" | sponge "$file"
done
- name: Commit and push
run: |
git config user.name "gitea-bot"
git config user.email "bot@smallgit.dasguney.com"
git add mods
if git commit -m "fetch upstream mod changes ($(date --utc +%Y%m%d_%H%M%SZ))"; then
git push
fi

View File

@@ -1,51 +0,0 @@
name: Update Mod Versions
on:
schedule:
- cron: '0 * * * *' # Run every hour
workflow_dispatch: # Allow manual triggers
jobs:
update-versions:
runs-on: ubuntu-latest
if: github.repository == 'skyline69/balatro-mod-index'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }} # Use PAT for checkout
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip' # This enables pip caching
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/scripts/requirements.lock
- name: Update mod versions
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
python .github/scripts/update_mod_versions.py
- name: Commit and push changes
run: |
git config --global user.name 'Version Update Bot'
git config --global user.email 'bot@noreply.github.com'
if [[ $(git status --porcelain) ]]; then
COMMIT_MSG="Auto-update mod versions"
if [ -f commit_message.txt ]; then
COMMIT_MSG=$(cat commit_message.txt)
fi
git add mods/*/meta.json
git commit -m "$COMMIT_MSG"
git push
else
echo "No changes to commit"
fi

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/ABuffZucchini/Greener-Jokers", "repo": "https://github.com/ABuffZucchini/Greener-Jokers",
"downloadURL": "https://github.com/ABuffZucchini/Greener-Jokers/archive/refs/heads/main.zip", "downloadURL": "https://github.com/ABuffZucchini/Greener-Jokers/archive/refs/heads/main.zip",
"folderName": "Greener-Jokers", "folderName": "Greener-Jokers",
"version": "a4a73ab", "version": "c1ae91c",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1759209396 "last-updated": 1766514520
} }

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/emmadenslemma/Agarmons", "repo": "https://github.com/emmadenslemma/Agarmons",
"downloadURL": "https://github.com/emmadenslemma/Agarmons/archive/refs/heads/main.zip", "downloadURL": "https://github.com/emmadenslemma/Agarmons/archive/refs/heads/main.zip",
"folderName": "Agarmons", "folderName": "Agarmons",
"version": "1274a77", "version": "6ec6e12",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1766374865 "last-updated": 1766471497
} }

View File

@@ -11,6 +11,6 @@
"repo": "https://github.com/BakersDozenBagels/BalatroBakery", "repo": "https://github.com/BakersDozenBagels/BalatroBakery",
"downloadURL": "https://github.com/BakersDozenBagels/BalatroBakery/archive/refs/heads/main.zip", "downloadURL": "https://github.com/BakersDozenBagels/BalatroBakery/archive/refs/heads/main.zip",
"automatic-version-check": true, "automatic-version-check": true,
"version": "05faca8", "version": "2d57d0e",
"last-updated": 1765495075 "last-updated": 1766539566
} }

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/Eternalnacho/NachosPokermonDip", "repo": "https://github.com/Eternalnacho/NachosPokermonDip",
"downloadURL": "https://github.com/Eternalnacho/NachosPokermonDip/archive/refs/heads/main.zip", "downloadURL": "https://github.com/Eternalnacho/NachosPokermonDip/archive/refs/heads/main.zip",
"folderName": "NachosPokermonDip", "folderName": "NachosPokermonDip",
"version": "3b57138", "version": "991c6e3",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1766398825 "last-updated": 1766507105
} }

View File

@@ -11,6 +11,6 @@
"repo": "https://github.com/InertSteak/Pokermon", "repo": "https://github.com/InertSteak/Pokermon",
"downloadURL": "https://github.com/InertSteak/Pokermon/archive/refs/heads/main.zip", "downloadURL": "https://github.com/InertSteak/Pokermon/archive/refs/heads/main.zip",
"automatic-version-check": true, "automatic-version-check": true,
"version": "7900bd5", "version": "dbb3302",
"last-updated": 1766428112 "last-updated": 1766531848
} }

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/Maelmc/Pokermon-Maelmc", "repo": "https://github.com/Maelmc/Pokermon-Maelmc",
"downloadURL": "https://github.com/Maelmc/Pokermon-Maelmc/archive/refs/heads/main.zip", "downloadURL": "https://github.com/Maelmc/Pokermon-Maelmc/archive/refs/heads/main.zip",
"folderName": "Pokermon-Maelmc", "folderName": "Pokermon-Maelmc",
"version": "4dcd6fd", "version": "3ae8967",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1766445494 "last-updated": 1766539566
} }

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/mpa-LHutchinson/Regals-Mod", "repo": "https://github.com/mpa-LHutchinson/Regals-Mod",
"downloadURL": "https://github.com/mpa-LHutchinson/Regals-Mod/archive/refs/heads/main.zip", "downloadURL": "https://github.com/mpa-LHutchinson/Regals-Mod/archive/refs/heads/main.zip",
"folderName": "RegalsMod", "folderName": "RegalsMod",
"version": "70888c0", "version": "2964001",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1766445494 "last-updated": 1766481822
} }

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/SonfiveTV/PokermonPlus", "repo": "https://github.com/SonfiveTV/PokermonPlus",
"downloadURL": "https://github.com/SonfiveTV/PokermonPlus/archive/refs/heads/main.zip", "downloadURL": "https://github.com/SonfiveTV/PokermonPlus/archive/refs/heads/main.zip",
"folderName": "PokermonPlus", "folderName": "PokermonPlus",
"version": "fe6cf61", "version": "7be47aa",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1766441926 "last-updated": 1766528293
} }

View File

@@ -8,7 +8,8 @@
], ],
"author": "Starlet Devil", "author": "Starlet Devil",
"repo": "https://github.com/AstrumNativus/AzzysJokers", "repo": "https://github.com/AstrumNativus/AzzysJokers",
"downloadURL": "https://github.com/AstrumNativus/AzzysJokers/archive/refs/tags/v2.0.1.zip", "downloadURL": "https://github.com/AstrumNativus/AzzysJokers/archive/refs/tags/v2.0.3.zip",
"automatic-version-check": true, "automatic-version-check": true,
"version": "v2.0.1" "version": "v2.0.3",
"last-updated": 1766481822
} }

View File

@@ -10,7 +10,7 @@
"repo": "https://github.com/ThorsGirdle/Toxic-Stall", "repo": "https://github.com/ThorsGirdle/Toxic-Stall",
"downloadURL": "https://github.com/ThorsGirdle/Toxic-Stall/archive/refs/heads/main.zip", "downloadURL": "https://github.com/ThorsGirdle/Toxic-Stall/archive/refs/heads/main.zip",
"folderName": "ToxicStall", "folderName": "ToxicStall",
"version": "ac50d66", "version": "3d197dd",
"automatic-version-check": true, "automatic-version-check": true,
"last-updated": 1766460288 "last-updated": 1766499545
} }