From 22eba9bdd6c58d842501fc9453994367a20d1d22 Mon Sep 17 00:00:00 2001 From: Wilfred Spiegelenburg Date: Tue, 12 Nov 2024 13:43:40 +1100 Subject: [PATCH] [YUNIKORN-2968] handle no content changes in auto-publish (#501) Any push to master will still trigger a build. That workflow will fail if it has nothing to commit into the asf-site branch. If there is no change in the content of the website we should just exit and let the build pass. Closes: #501 Signed-off-by: Wilfred Spiegelenburg --- .github/workflows/auto-publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml index 637ebf9a06..4cf231b07e 100644 --- a/.github/workflows/auto-publish.yml +++ b/.github/workflows/auto-publish.yml @@ -53,5 +53,9 @@ jobs: git config --local user.email "yunikornscheduler@gmail.com" git config --local user.name "yunikorn-bot" git add . - git commit -aF ../asf-site-commit.txt - git push + if output=$(git status --porcelain) && [ -z "$output" ]; then + echo "nothing changed, skipping commit" + else + git commit -aF ../asf-site-commit.txt + git push + fi