Automate blacklist updater

This commit is contained in:
Be
2024-03-02 12:18:03 +01:00
parent c83f934539
commit 75f33b7d28

View File

@@ -39,14 +39,17 @@ jobs:
with: with:
python-version: '3.12' python-version: '3.12'
- run: ./requirements.sh - run: ./requirements.sh
- run: curl ifconfig.io -q - run: curl -s ifconfig.io
- run: ./blacklists_updater.sh - run: ./blacklists_updater.sh
- run: | - run: |
timestamp=`date "+%Y.%m.%d %H:%M:%S"` timestamp=`date "+%Y.%m.%d %H:%M:%S"`
git config --global user.name "${{ env.REPO_OWNER }}" git config --global user.name "${{ env.REPO_OWNER }}"
git config --global user.email "${{ env.REPO_OWNER }}@github.com" git config --global user.email "${{ env.REPO_OWNER }}@github.com"
git status
git diff
git add blacklist*txt git add blacklist*txt
git commit -m "Update $timestamp" git diff --staged --exit-code || echo "No changes to commit"
git push https://${{ env.GH_PAT }}@github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git 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