-
-
Notifications
You must be signed in to change notification settings - Fork 16
57 lines (47 loc) · 1.56 KB
/
sort.yml
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
name: Sort Lists | My Privacy DNS
on:
push:
branches:
- master
jobs:
sort-lists:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install GNU parallel
run: sudo apt-get update && sudo apt-get install -y parallel
- name: Install My Privacy DNS python module
run: |
pip install --no-cache-dir -r "${{ github.workspace }}/requirements.txt"
- name: Check for changes in source folder
id: check_changes
run: |
git diff --name-only HEAD^ HEAD | grep -E '^source/'
echo "::set-output name=changed_files::$(git diff --name-only HEAD^ HEAD | grep -E '^source/')"
- name: Sort source files
if: env.changes == 'true'
continue-on-error: true
run: |
python3 tools/sort_lists.py
- name: Configure Git
run: |
git config --global user.name "spirillen"
git config --global user.email "[email protected]"
git config --global --add safe.directory /github/workspace
- name: Commit changes
if: env.changes == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if git diff --staged --quiet; then
echo "We are good, no changes to the sources"
else
git add .
git commit -m "Sorted files"
git push
fi