fix(auto-update): not committing changes

This commit is contained in:
Technocality
2025-07-21 15:36:58 -05:00
parent 6d8c0966ab
commit 357944fac1

View File

@@ -1,8 +1,6 @@
name: Auto Update
on:
workflow_dispatch:
jobs:
update-modpacks:
runs-on: ubuntu-latest
@@ -14,7 +12,6 @@ jobs:
minecraft: [1.20.1, 1.20.4, 1.21.1, 1.21.3, 1.21.4, 1.21.5, 1.21.8]
max-parallel: 3 # Helps with rate limiting
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
@@ -62,17 +59,42 @@ jobs:
- name: Rate limiting delay
run: sleep 10
# Check if there are changes and upload them
- name: Check for changes
id: check-changes
run: |
if git diff --quiet; then
echo "has-changes=false" >> $GITHUB_OUTPUT
else
echo "has-changes=true" >> $GITHUB_OUTPUT
fi
# Upload the entire workspace if there are changes
- name: Upload changes
if: steps.check-changes.outputs.has-changes == 'true'
uses: actions/upload-artifact@v4
with:
name: changes-${{ strategy.job-index }}
path: versions/
retention-days: 1
commit-changes:
needs: update-modpacks
runs-on: ubuntu-22.04
if: always() # Run even if some matrix jobs fail
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
fetch-depth: 1
- name: Pull latest changes
run: git pull origin main
# Download all artifacts from matrix jobs
- name: Download all changes
uses: actions/download-artifact@v4
with:
pattern: changes-*
merge-multiple: true
path: ./
- name: Commit Updates
uses: EndBug/add-and-commit@v9.1.4