From 379c339f978f1578d5b5088a4cade81ea880b8a3 Mon Sep 17 00:00:00 2001 From: Chenghao Mou Date: Tue, 6 Aug 2024 19:40:01 +0100 Subject: [PATCH] skip push if no change --- .github/workflows/daily_update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily_update.yml b/.github/workflows/daily_update.yml index 1e36f7b..4cc04e0 100644 --- a/.github/workflows/daily_update.yml +++ b/.github/workflows/daily_update.yml @@ -16,7 +16,7 @@ jobs: git config --global user.name "dark-visitors" git config --global user.email "dark-visitors@users.noreply.github.com" python code/dark_visitors.py + git add -A - git commit -m "Daily update from Dark Visitors" - git push + git diff --quiet && git diff --staged --quiet || (git commit -m "Daily update from Dark Visitors" && git push) shell: bash \ No newline at end of file