Repository navigation
54 lines (50 loc) · 1.83 KB
/
Copy pathpython_clean_blocklists.yml
File metadata and controls
54 lines (50 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Python Run - removes bad domains from blocklists
on:
workflow_dispatch:
# Grant write permissions for all jobs in this workflow
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 50
strategy:
matrix:
python-version: ["3.15"]
steps:
- name: Checkout repository
uses: actions/checkout@v7 # Action to clone the repo
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }} # Specify the Python version
- name: Cache pip packages
id: pip-cache
uses: actions/cache@v6
with:
# Cache key includes OS, Python version, and a hash of the lock file
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# Restore from any previous cache with the same OS and Python version
restore-keys: |
${{ runner.os }}-pip-
# Directories to cache (default pip cache location)
path: |
~/.cache/pip
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run check_domains.py
run: python "Testing/check_domains.py" blocklist_combined_filterlist.txt_005.txt -o Testing/blocklist_combined_filterlist_005.txt --concurrency 10000
- name: Commit and push changes
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "clean blocklists"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SOURCES:
# https://github.com/actions/setup-python
# https://github.com/actions/checkout
# https://github.com/actions/cache