-
Notifications
You must be signed in to change notification settings - Fork 4.8k
44 lines (37 loc) · 1.17 KB
/
upgradle-to-latest-wrapper.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Upgradle to latest wrapper
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
upgradle-latest-wrapper:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: bot/upgradle-to-latest-wrapper
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Updadle to latest nightly and push to bot/upgradle-to-latest-wrapper
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git reset origin/master --hard
./gradlew wrapper --gradle-version=nightly
if ! git diff --quiet; then
./gradlew -v
VERSION=$(./gradlew -v | grep "Gradle" | cut -d' ' -f2)
git add .
git commit -m "Update Gradle wrapper to $VERSION"
git push --force origin bot/upgradle-to-latest-wrapper
else
echo "No changes to commit"
fi