From 75f33b7d2802daa2da43ba3bea2f33ee4fbd18d8 Mon Sep 17 00:00:00 2001 From: Be Date: Sat, 2 Mar 2024 12:18:03 +0100 Subject: [PATCH] Automate blacklist updater --- .github/workflows/bl.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bl.yml b/.github/workflows/bl.yml index 27f0056..4f6e395 100644 --- a/.github/workflows/bl.yml +++ b/.github/workflows/bl.yml @@ -39,14 +39,17 @@ jobs: with: python-version: '3.12' - run: ./requirements.sh - - run: curl ifconfig.io -q + - run: curl -s ifconfig.io - run: ./blacklists_updater.sh - run: | timestamp=`date "+%Y.%m.%d %H:%M:%S"` git config --global user.name "${{ env.REPO_OWNER }}" git config --global user.email "${{ env.REPO_OWNER }}@github.com" - git status - git diff git add blacklist*txt - git commit -m "Update $timestamp" - git push https://${{ env.GH_PAT }}@github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git + git diff --staged --exit-code || echo "No changes to commit" + if [ $? -ne 0 ]; then + git commit -m "Update $timestamp" + git push https://${{ env.GH_PAT }}@github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git + else + echo "No changes to commit" + fi