-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.79 KB
/
Copy pathfetch-and-regenerate-lists.yml
File metadata and controls
63 lines (54 loc) · 1.79 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
55
56
57
58
59
60
61
62
63
# This workflow will install Python dependencies, fetch external sources and generate blocklists with a single version of Python
name: Fetch updates
on:
schedule:
- cron: '17 11 * * 1-5'
workflow_dispatch:
permissions:
contents: write
jobs:
fetch-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: "pip"
check-latest: false
- name: Install dependencies
run: |
# python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Update external sources
run: |
python "./scripts/import_from_wiki_gg.py"
python "./scripts/import_from_indie_wiki.py"
- name: Generate blocklists from sources
run: |
python "./scripts/generate_blocklists.py"
- name: Check for Changes
id: check_changes
run: |
if [[ -n "$(git diff --exit-code)" ]]; then
echo "Changes detected."
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "No changes detected."
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit and Push Changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
# configure user
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
# stage any file changes to be committed
git add .
# make commit with staged changes
git commit -m 'build(lists): auto update blocklists'
# push the commit back up to source GitHub repository
git push