Skip to content

Commit

Permalink
Fix workflow (#15)
Browse files Browse the repository at this point in the history
* Create auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Updated Upstream (Gale)

* Update auto-update.yml

* Update auto-update.yml

* Updated Upstream (Gale)

* Update auto-update.yml

* Update gradle.properties

* Updated Upstream (Gale)

* test

* Updated Upstream (Gale)

* Update auto-update.yml

* test

* Updated Upstream (Gale)

* Update auto-update.yml

* test

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Updated Upstream (Gale)

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Update gradle.properties

---------

Co-authored-by: HaHaWTH <HaHaWTH@users.noreply.github.com>
Co-authored-by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent 4ac76f2 commit 1fa3239
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Automatically update Gale commit hash

on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -34,15 +36,31 @@ 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
git commit -m "Updated Upstream (Gale)"
git push
else
echo "No changes to commit."
fi
fi

0 comments on commit 1fa3239

Please sign in to comment.