diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml new file mode 100644 index 000000000..7364da139 --- /dev/null +++ b/.github/workflows/stats.yml @@ -0,0 +1,39 @@ +name: Update Blacklist Stats + +on: + schedule: + # Run once a day at midnight UTC + - cron: '0 0 * * *' + workflow_dispatch: # Allows manual triggering + +jobs: + update_stats: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pip install --upgrade pip + + - name: Download blacklist file + run: wget -O blacklist.txt https://github.com/fabriziosalmi/blacklists/releases/download/latest/blacklist.txt + + - name: Generate stats and update markdown + run: | + python scripts/generate_stats.py + + - name: Commit and push changes + uses: EndBug/add-and-commit@v7 + with: + author_name: 'GitHub Action' + author_email: 'action@github.com' + message: 'Update blacklist stats' + add: 'stats.md'