-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (39 loc) · 1.12 KB
/
merge-hosts.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
name: Merge hosts files from different sources.
on:
schedule:
- cron: '0 5 * * 0'
workflow_dispatch:
defaults:
run:
working-directory: ./
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create dist directory
run: |
mkdir -p dist
rm -f dist/hosts dist/hosts-ipv4
- name: EasyPrivacy
run: |
cat easyprivacy/dist/hosts >> dist/hosts
cat easyprivacy/dist/hosts-ipv4 >> dist/hosts-ipv4
- name: Exodus
run: |
echo >> dist/hosts
echo >> dist/hosts-ipv4
cat exodus/dist/hosts >> dist/hosts
cat exodus/dist/hosts-ipv4 >> dist/hosts-ipv4
- name: Create hosts file without IP addresses
run: |
cat dist/hosts | egrep -v '^([0-9]{1,3}\.){3}[0-9]{1,3}$' > dist/hosts-noip
- name: Commit changes
uses: EndBug/add-and-commit@v5.3.0
with:
author_name: Marcus Husar
author_email: marcus.husar@gmail.com
message: 'Update merged hosts files from different sources.'
add: 'dist'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}