Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatically update upstream workflow #14

Merged
merged 10 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Automatically update Gale commit hash
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Leaf Repository
uses: actions/checkout@v3
with:
path: 'Leaf'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Gale Repository
uses: actions/checkout@v3
with:
path: 'Gale'
repository: "Dreeam-qwq/Gale"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Gale Latest Commit Hash
id: galeCommit
run: |
ls
cd Gale
echo "::set-output name=galeCommit::$(git rev-parse HEAD)"
cd ..

- name: Update galeCommit in Leaf 
run: |
cd Leaf
sed -i "s/\(galeCommit\s*=\s*\).*/\1$PAPER_REF/" gradle.properties
env:
PAPER_REF: ${{ steps.galeCommit.outputs.galeCommit }}
- name: Check for changes and Write to repository
run: |
cd Leaf
if ! git diff --quiet; then
git add gradle.properties
git config --global user.name "github-actions"
git config --global user.email [email protected]
git commit -m "Updated Upstream (Gale)"
git push
else
echo "No changes to commit."
fi
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = org.dreeam.leaf
version = 1.20.4-R0.1-SNAPSHOT

galeCommit = 78098840227379410ccc610bddafa6a7956c6ddd
galeCommit = 07a2ca6b82a3b809d6b89213b0648ef9067858b6

org.gradle.caching = true
org.gradle.parallel = true
Expand Down