Skip to content
name: Update the gradle wrapper to the latest version
on:
push:
branches:
- 'update/**'
- 'dev/**'
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
update-gradle-wrapper:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest Gradle version
id: get_latest_gradle
run: |
latest_version=$(curl -s https://services.gradle.org/versions/current | jq -r '.version')
echo "LATEST_GRADLE_VERSION=$latest_version" >> $GITHUB_ENV
- name: Update gradle.properties
run: |
sed -i "s|^distributionUrl=.*$|distributionUrl=https\://services.gradle.org/distributions/gradle-${LATEST_GRADLE_VERSION}-bin.zip|" gradle/wrapper/gradle-wrapper.properties
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add gradle/wrapper/gradle-wrapper.properties
git commit -m "Update Gradle wrapper to ${LATEST_GRADLE_VERSION}"
git push