Bump actions/setup-java from 3 to 4
[storage-units.git] / .github / workflows / update-parent.yml
blob8a7cab7002f32cc52c88b2f028006ccebed72892
1 # SPDX-FileCopyrightText: The Storage-Units Authors
2 # SPDX-License-Identifier: 0BSD
4 name: Update Parent
5 on:
6   schedule:
7     - cron: 0 1 5 * *
8 jobs:
9   parent:
10     runs-on: ubuntu-latest
11     steps:
12       - name: Clone Git Repository
13         uses: actions/checkout@v4
14       - uses: ./.github/actions/managed-java
15       - uses: actions/cache@v3
16         with:
17           path: ~/.m2/repository
18           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
19           restore-keys: |
20             ${{ runner.os }}-maven-
21       - name: Update Parent
22         run: mvn --batch-mode --define generateBackupPoms=false versions:update-parent
23       - id: cpr
24         name: Create Pull Request
25         uses: peter-evans/create-pull-request@v5
26         with:
27           token: ${{ secrets.PAT }}
28           commit-message: Update parent to latest version
29           committer: GitHub <noreply@github.com>
30           author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
31           title: Update parent to latest version
32           body: |
33             `mvn --batch-mode --define generateBackupPoms=false versions:update-parent`
34           assignees: sebhoss
35           draft: false
36           base: main
37           branch: update-parent
38           delete-branch: true
39       - id: automerge
40         name: Enable Pull Request Automerge
41         if: steps.cpr.outputs.pull-request-operation == 'created'
42         run: gh pr merge --rebase --auto "${{ steps.cpr.outputs.pull-request-number }}"
43         env:
44           GH_TOKEN: ${{ secrets.PAT }}