unique job names
[reguloj.git] / .github / workflows / update-parent.yml
blob3489d72c1e8d5432c86b722166b2cdc46310d848
1 name: Update Parent
2 on:
3   schedule:
4     - cron:  0 1 11 * *
5 env:
6   JAVA_VERSION: 17
7   JAVA_PACKAGE: jdk
8   JAVA_ARCH: x64
9   JAVA_DISTRO: temurin
10 jobs:
11   parent:
12     runs-on: ubuntu-latest
13     steps:
14       - uses: actions/checkout@v3
15       - name: Set up Java
16         uses: actions/setup-java@v3
17         with:
18           java-version: ${{ env.JAVA_VERSION }}
19           java-package: ${{ env.JAVA_PACKAGE }}
20           architecture: ${{ env.JAVA_ARCH }}
21           distribution: ${{ env.JAVA_DISTRO }}
22       - uses: actions/cache@v3
23         with:
24           path: ~/.m2/repository
25           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26           restore-keys: |
27             ${{ runner.os }}-maven-
28       - name: Update parent
29         run: mvn --batch-mode versions:update-parent -DgenerateBackupPoms=false
30       - name: Create Pull Request
31         id: cpr
32         uses: peter-evans/create-pull-request@v4
33         with:
34           token: ${{ secrets.PAT }}
35           commit-message: Update parent to latest version
36           committer: GitHub <noreply@github.com>
37           author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
38           title: Update parent to latest version
39           body: |
40             `mvn --batch-mode --define generateBackupPoms=false versions:update-parent`
41           labels: enhancement
42           assignees: sebhoss
43           draft: false
44           base: main
45           branch: update-parent
46           delete-branch: true
47       - id: automerge
48         name: Enable Pull Request Automerge
49         if: steps.cpr.outputs.pull-request-operation == 'created'
50         uses: peter-evans/enable-pull-request-automerge@v2
51         with:
52           token: ${{ secrets.PAT }}
53           pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
54           merge-method: rebase