diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 6f7dc85e..50e71453 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -1,8 +1,10 @@ name: Automatically update Gale commit hash + on: workflow_dispatch: {} schedule: - cron: "0 0 * * *" + jobs: build: runs-on: ubuntu-latest @@ -34,10 +36,26 @@ jobs: sed -i "s/\(galeCommit\s*=\s*\).*/\1$PAPER_REF/" gradle.properties env: PAPER_REF: ${{ steps.galeCommit.outputs.galeCommit }} + + - name: Grant execute permission for gradlew + run: | + cd Leaf + chmod +x gradlew + + - name: Running tests before push + run: | + cd Leaf + if ! git diff --quiet; then + echo "Running tests...." + ./gradlew applyPatches + ./gradlew createReobfPaperclipJar + fi + - name: Check for changes and Write to repository run: | cd Leaf if ! git diff --quiet; then + echo "Writing to repo....." git add gradle.properties git config --global user.name "github-actions" git config --global user.email no-reply@github.com @@ -45,4 +63,4 @@ jobs: git push else echo "No changes to commit." - fi + fi \ No newline at end of file