-
Notifications
You must be signed in to change notification settings - Fork 151
50 lines (42 loc) · 1.34 KB
/
format.yml
File metadata and controls
50 lines (42 loc) · 1.34 KB
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
name: Java Code Format
on:
push:
branches:
- 'sdk-automation/models'
permissions:
contents: write
jobs:
format:
if: ${{ github.event.commits != null && !startsWith(github.event.head_commit.message, 'style(fmt)') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
with:
java-version: '20'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Run Spotless Apply
run: mvn spotless:apply
- name: Commit and Push Changes
env:
BOT_EMAIL: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
run: |
git config user.name AdyenAutomationBot
git config user.email "$BOT_EMAIL"
git add .
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "style(fmt): code formatted"
git push
fi