Skip to content

style(fmt): code formatted #539

style(fmt): code formatted

style(fmt): code formatted #539

Workflow file for this run

name: Java Code Format
on:
workflow_dispatch:
push:
branches:
- 'sdk-automation/*'
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