From 364129375df390a0ccbe3c3109169213359507d9 Mon Sep 17 00:00:00 2001 From: leonardog Date: Fri, 9 Jan 2026 14:11:32 +0100 Subject: [PATCH 1/3] feat(ci): create in place formatting workflow for composable steps --- .github/actions/format/action.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/actions/format/action.yml diff --git a/.github/actions/format/action.yml b/.github/actions/format/action.yml new file mode 100644 index 000000000..7417ffc5b --- /dev/null +++ b/.github/actions/format/action.yml @@ -0,0 +1,27 @@ +name: 'Format Java Code' +description: 'Runs mvn spotless:apply' +inputs: + path: + description: 'Path to the java repository' + required: true +runs: + using: 'composite' + steps: + - name: Set up JDK 20 for formatting + uses: actions/setup-java@v4 + with: + java-version: '20' + distribution: 'adopt' + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles(format('{0}/**/pom.xml', inputs.path)) }} + restore-keys: | + ${{ runner.os }}-m2- + + - name: Run Spotless Apply + run: mvn spotless:apply + shell: bash + working-directory: ${{ inputs.path }} From 2560c2fa3a8a0d1147295e2bd6c33809813a7fa8 Mon Sep 17 00:00:00 2001 From: leonardog Date: Mon, 12 Jan 2026 13:34:34 +0100 Subject: [PATCH 2/3] refactor(ci): centralize formatting logic into a composite action --- .github/actions/format/action.yml | 10 +++++----- .github/workflows/format.yml | 22 ++++++---------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/actions/format/action.yml b/.github/actions/format/action.yml index 7417ffc5b..c07ff57d5 100644 --- a/.github/actions/format/action.yml +++ b/.github/actions/format/action.yml @@ -7,14 +7,14 @@ inputs: runs: using: 'composite' steps: - - name: Set up JDK 20 for formatting - uses: actions/setup-java@v4 + - name: Set up JDK 11 for formatting + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v4.2.1 with: - java-version: '20' - distribution: 'adopt' + java-version: '11' + distribution: 'temurin' - name: Cache Maven packages - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.0.2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles(format('{0}/**/pom.xml', inputs.path)) }} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 5c85cd01b..d2420c874 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,4 +1,6 @@ -name: Java Code Format +# Deprecated + +name: Format and Commit Java Code on: workflow_dispatch: @@ -19,22 +21,10 @@ jobs: 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 + - name: Format Java Code + uses: ./.github/actions/format with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-m2- - - - name: Run Spotless Apply - run: mvn spotless:apply + path: . - name: Commit and Push Changes env: From c43e3e13df3b1f01b8d4c366f84bd28c6d067053 Mon Sep 17 00:00:00 2001 From: Leonardo Galesky Date: Mon, 12 Jan 2026 14:55:15 +0100 Subject: [PATCH 3/3] Update format.yml --- .github/workflows/format.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d2420c874..cdbe9e890 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,12 +1,7 @@ -# Deprecated - name: Format and Commit Java Code on: workflow_dispatch: - push: - branches: - - 'sdk-automation/*' permissions: contents: write