Skip to content

Commit 2560c2f

Browse files
committed
refactor(ci): centralize formatting logic into a composite action
1 parent 3641293 commit 2560c2f

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

.github/actions/format/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ inputs:
77
runs:
88
using: 'composite'
99
steps:
10-
- name: Set up JDK 20 for formatting
11-
uses: actions/setup-java@v4
10+
- name: Set up JDK 11 for formatting
11+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v4.2.1
1212
with:
13-
java-version: '20'
14-
distribution: 'adopt'
13+
java-version: '11'
14+
distribution: 'temurin'
1515

1616
- name: Cache Maven packages
17-
uses: actions/cache@v4
17+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.0.2
1818
with:
1919
path: ~/.m2
2020
key: ${{ runner.os }}-m2-${{ hashFiles(format('{0}/**/pom.xml', inputs.path)) }}

.github/workflows/format.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: Java Code Format
1+
# Deprecated
2+
3+
name: Format and Commit Java Code
24

35
on:
46
workflow_dispatch:
@@ -19,22 +21,10 @@ jobs:
1921
with:
2022
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
2123

22-
- name: Set up JDK
23-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165
24-
with:
25-
java-version: '20'
26-
distribution: 'adopt'
27-
28-
- name: Cache Maven packages
29-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
24+
- name: Format Java Code
25+
uses: ./.github/actions/format
3026
with:
31-
path: ~/.m2
32-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
33-
restore-keys: |
34-
${{ runner.os }}-m2-
35-
36-
- name: Run Spotless Apply
37-
run: mvn spotless:apply
27+
path: .
3828

3929
- name: Commit and Push Changes
4030
env:

0 commit comments

Comments
 (0)