-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automatically update upstream workflow (#14)
* 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) --------- Co-authored-by: HaHaWTH <HaHaWTH@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 no-reply@github.com | ||
git commit -m "Updated Upstream (Gale)" | ||
git push | ||
else | ||
echo "No changes to commit." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters