From d80f132ce773b78df9d8de8404c845f807cdf2d1 Mon Sep 17 00:00:00 2001 From: Martin Bernstorff Date: Mon, 15 Sep 2025 10:35:52 +0200 Subject: [PATCH 1/2] ci: remove success message from formatting check The workflow succeeds giving a green check-mark next to the commit id. Perhaps writing a comment each time is redundant? E.g.: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/856 --- .github/workflows/spotless-check.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/spotless-check.yml b/.github/workflows/spotless-check.yml index f4e616fbb45..73e4e85dd2e 100644 --- a/.github/workflows/spotless-check.yml +++ b/.github/workflows/spotless-check.yml @@ -23,8 +23,6 @@ jobs: if: always() with: proxy-url: https://slack-bots.azure.smilecdr.com/robogary/github - message-success: | - Formatting check succeeded! message-failure: | **This Pull Request has failed the formatting check** From 7dce677c07d20c5460ad6d433b91f60a6418a02b Mon Sep 17 00:00:00 2001 From: Martin Bernstorff Date: Mon, 15 Sep 2025 10:38:59 +0200 Subject: [PATCH 2/2] Update spotless check workflow to handle failures Modify condition for PR comment action to run only on failure. --- .github/workflows/spotless-check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spotless-check.yml b/.github/workflows/spotless-check.yml index 73e4e85dd2e..6fb1bbeca8a 100644 --- a/.github/workflows/spotless-check.yml +++ b/.github/workflows/spotless-check.yml @@ -20,9 +20,12 @@ jobs: - name: spotless:check run: mvn spotless:check - uses: mshick/add-pr-comment@v2 - if: always() + # Only run if the previous step failed + if: failure() && steps.spotless_check.outcome == 'failure' with: proxy-url: https://slack-bots.azure.smilecdr.com/robogary/github + message-success: | + Formatting check succeeded! This should never run, because the step is skipped on workflow success. message-failure: | **This Pull Request has failed the formatting check**