You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2026/07/09 15:30:13 UTC

(grails-forge-ui) 01/01: Skip gh-pages commit when build output is unchanged

This is an automated email from the ASF dual-hosted git repository.

jdaugherty pushed a commit to branch fix/publish-no-changes
in repository https://gitbox.apache.org/repos/asf/grails-forge-ui.git

commit f56a97e803bd68882a60a4e0c62134c46c3f662b
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Thu Jul 9 11:30:02 2026 -0400

    Skip gh-pages commit when build output is unchanged
    
    With set -e, 'git commit' failing on an empty diff (e.g. after merges
    that only touch workflow files) aborted the Publish run with exit 1.
    Restore the no-changes guard, checking the staged diff after 'git add -A'
    so new files are also detected.
---
 publish.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/publish.sh b/publish.sh
index ce4f4cd..b8a7494 100755
--- a/publish.sh
+++ b/publish.sh
@@ -30,13 +30,13 @@ fi
 git clone https://${GH_TOKEN}@github.com/${GITHUB_SLUG}.git -b gh-pages gh-pages --single-branch > /dev/null
 cd gh-pages
 cp -r ../build/launch/* .
-#if git diff --quiet; then
-#  echo "No changes in Grails Forge UI"
-#else
 git add -A
-git commit -a -m "Updating $GITHUB_SLUG gh-pages branch for Github Actions run:$GITHUB_RUN_ID"
-git push https://oauth2:${GH_TOKEN}@github.com/${GITHUB_SLUG}.git gh-pages
-#fi
+if git diff --cached --quiet; then
+  echo "No changes in Grails Forge UI"
+else
+  git commit -m "Updating $GITHUB_SLUG gh-pages branch for Github Actions run:$GITHUB_RUN_ID"
+  git push https://oauth2:${GH_TOKEN}@github.com/${GITHUB_SLUG}.git gh-pages
+fi
 cd ..
 rm -rf gh-pages