From 42b2144e3b5859c993f767cf20c4d26b321b0d81 Mon Sep 17 00:00:00 2001 From: Chris Schindlbeck Date: Mon, 24 Mar 2025 06:56:53 +0100 Subject: [PATCH] fix(ci) GH Pages: Do not commit and push if there are no changes --- .github/workflows/docs.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 48cdbc069..7308c70d4 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -38,5 +38,9 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add -A - git commit -m "Publish docs from $GITHUB_SHA" - git push https://github.com/$GITHUB_REPOSITORY.git gh-pages + if ! git diff-index --quiet HEAD; then + git commit -m "Publish docs from $GITHUB_SHA" + git push https://github.com/$GITHUB_REPOSITORY.git gh-pages + else + echo "No changes to commit" + fi