fix(ci): revert spotlessApply on master

Updated CI workflow to use the commit SHA for ref in pull requests and simplified the condition for applying formatting changes.
This commit is contained in:
Fiereu authored and GitHub committed 2026-07-28 13:26:35 +02:00
1 parent 4e90abe398
commit f57149eae3
1 file changed
+4 -9
+4 -9
View File
@@ -23,7 +23,7 @@ jobs:
submodules: recursive submodules: recursive
# On pull requests check out the branch itself, not the detached merge # On pull requests check out the branch itself, not the detached merge
# commit, so the formatting commit can be pushed back. # commit, so the formatting commit can be pushed back.
ref: ${{ github.head_ref || github.ref_name }} ref: ${{ github.head_ref || github.sha }}
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 25 - name: Set up JDK 25
@@ -36,15 +36,10 @@ jobs:
uses: gradle/actions/setup-gradle@v6 uses: gradle/actions/setup-gradle@v6
- name: Apply Spotless and push formatting changes - name: Apply Spotless and push formatting changes
# Only pull request branches from this repository and on master,
# where the formatting commit can be pushed back.
# Everywhere else the spotlessCheck inside the check task must
# fail on violations instead of hiding them.
if: >- if: >-
(github.event_name == 'push' && github.ref_name == github.event.repository.default_branch) github.event_name == 'pull_request' &&
|| (github.event_name == 'pull_request' github.event.pull_request.head.repo.full_name == github.repository &&
&& github.event.pull_request.head.repo.full_name == github.repository github.event.pull_request.user.login != 'renovate[bot]'
&& github.event.pull_request.user.login != 'renovate[bot]')
run: | run: |
./gradlew spotlessApply ./gradlew spotlessApply
if git diff --quiet; then if git diff --quiet; then