From 02c50fc807680a3c5314b459a0ef091481c13011 Mon Sep 17 00:00:00 2001 From: ObcbO <49872497+ObcbO@users.noreply.github.com> Date: Sat, 22 Apr 2023 18:47:18 +0800 Subject: [PATCH] Update update.yml --- .github/workflows/update.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 842ceaa..f373ca1 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -21,12 +21,24 @@ jobs: - name: Submodule run: sh update.sh - + + - name: Check for changes + id: check_changes + run: | + if git diff --quiet; then + echo "No changes detected" + echo "::set-output name=push_required::false" + else + echo "Changes detected" + echo "::set-output name=push_required::true" + fi + - name: Deploy + if: steps.check_changes.outputs.push_required == 'true' run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@github.com" git add --all git commit -m "$(date +'%Y-%m-%dT%H:%M:%S')" git push - \ No newline at end of file +