Update Mod Versions #8030
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |