generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.69 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
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@0407394b9d173dfc9cf5695f9f560fef6d61a5fe # v1
with:
labels: dependencies
repo-token: ${{ steps.app-token.outputs.token }}
- 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@5c7daabae956f8143277417996b26a173439e1b7 # v1.4.1
with:
fail-on-no-changes: false
force: true
message: Bump Gradle Wrapper to the latest version
token: ${{ steps.app-token.outputs.token }}