generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.73 KB
/
gradle.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 }}