From 2c957fd82abdc8c0407d441ec3c782dab4b89b2a Mon Sep 17 00:00:00 2001 From: Satr14 <90962949+SX-9@users.noreply.github.com> Date: Sat, 22 Mar 2025 09:35:11 +0000 Subject: [PATCH] fix fail from no changes --- .github/workflows/db.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/db.yml b/.github/workflows/db.yml index ebb4396..e4f2b6e 100644 --- a/.github/workflows/db.yml +++ b/.github/workflows/db.yml @@ -26,14 +26,19 @@ jobs: - name: Generate statistics run: | - node scripts/dict.js > stats/dict.json 2>&1 & - ls domains | wc -l > stats/count.txt 2>&1 & - wait + rm stats/*_error.log + node scripts/dict.js > stats/dict.json 2>stats/dict_error.log & + ls domains | wc -l > stats/count.txt 2>stats/count_error.log & + wait + - name: Commit changes run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add stats/dict.json stats/count.txt - git commit -m "[automated] update stats" - git push + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add stats + + if [ -n "$(git status --porcelain)" ]; then + git commit -m "[automated] update stats" + git push + fi