diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3d4b1504d..0a9d9a7b5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -29,14 +29,27 @@ jobs:
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v7
+ with:
+ # ratchetFrom needs history reachable to the base/before commit
+ fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
+ - name: Determine Spotless ratchet ref
+ shell: bash
+ run: |
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
+ ref="${{ github.event.pull_request.base.sha }}"
+ else
+ ref="${{ github.event.before }}"
+ [ "$ref" = "0000000000000000000000000000000000000000" ] && ref=""
+ fi
+ [ -n "$ref" ] && echo "RATCHET=-DratchetFrom=$ref" >> "$GITHUB_ENV"
- name: Build with Maven
- run: ./mvnw $mvn_options install -PnoGpg --file pom.xml
+ run: ./mvnw $mvn_options install $RATCHET -PnoGpg --file pom.xml
- name: Run ProvidersDocsGenerator
if: ${{ matrix.java-version == env.jdk_for_downstream && matrix.runs-on == env.os_for_downstream }}
run: ./mvnw $mvn_options exec:java -Dexec.mainClass="net.datafaker.script.ProvidersDocsGenerator" -Dexec.classpathScope=test -PnoGpg --file pom.xml
diff --git a/.gitignore b/.gitignore
index 99fd71d7a..95a329764 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ bin/
site
.mvn/wrapper/maven-wrapper.jar
/.claude/settings.local.json
+.spotless-index-file
diff --git a/pom.xml b/pom.xml
index aec504ab7..7455eb47c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,6 +55,8 @@
3.28.2
2.6
3.7.0
+
+
@{argLine} -Duser.language=TR -Duser.country=tr
@@ -269,6 +271,11 @@
+
+ true
+ ${project.basedir}/.spotless-index-file
+
+ ${spotless.ratchetFrom}