Skip to content

Gradle

Gradle #677

Workflow file for this run

name: Gradle
on:
workflow_dispatch:
schedule:
- cron: "30 5 * * MON-FRI" # Every weekday at 05:30 UTC
push:
paths:
- gradlew
- gradlew.bat
- gradle/**
- .github/workflows/gradle.yml
jobs:
validate-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
update-wrapper:
runs-on: ubuntu-latest
if: github.ref_name == 'main'
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: main
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- uses: gradle-update/update-gradle-wrapper-action@9268373d69bd0974b6318eb3b512b8e025060bbe # v2.0.0
with:
labels: dependencies
repo-token: ${{ steps.app-token.outputs.token }}
merge-method: SQUASH
- name: Reset commit author # workaround for https://github.com/gradle-update/update-gradle-wrapper-action/issues/124
continue-on-error: true
run: |
if [ "$(git branch --show-current)" != main ]; then
git reset --soft "HEAD~$(find . -type f -name gradlew | wc -l)"
fi
- name: Commit and push
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
with:
fail-on-no-changes: false
force: true
message: Bump Gradle Wrapper to the latest version
token: ${{ steps.app-token.outputs.token }}