mirror of
https://github.com/Nostalgica-Reverie/Content-Monorepo.git
synced 2026-05-09 00:24:15 +00:00
fix(auto-update): not committing changes
This commit is contained in:
32
.github/workflows/auto-update.yml
vendored
32
.github/workflows/auto-update.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user