-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-workflow
More file actions
41 lines (34 loc) · 1.41 KB
/
update-workflow
File metadata and controls
41 lines (34 loc) · 1.41 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
name: Update CIDR Lists
on:
schedule:
- cron: "0 0 * * *"
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fetch Telegram CIDR List
run: |
curl -s "https://core.telegram.org/resources/cidr.txt" > Telegram-CIDR.rsc
# Additional processing steps (Converting to .rsc format)
sed -nEi 's/(([0-9]+\.){3}[0-9]+) */add list=Telegram address=\1/p' Telegram-CIDR.rsc
sed -i '1 i\\/ip firewall address-list' Telegram-CIDR.rsc
- name: Fetch Whatsapp CIDR List
run: |
curl -s "https://raw.githubusercontent.com/HybridNetworks/whatsapp-cidr/main/WhatsApp/whatsapp_cidr_ipv4.txt" > Whatsapp-CIDR.rsc
# From a project by HybridNetworks: https://github.com/HybridNetworks/whatsapp-cidr?tab=readme-ov-file
# Additional processing steps (Converting to .rsc format)
sed -nEi 's/(([0-9]+\.){3}[0-9]+) */add list=Whatsapp address=\1/p' Whatsapp-CIDR.rsc
sed -i '1 i\\/ip firewall address-list' Whatsapp-CIDR.rsc
# Add more steps to process the data and commit changes
- name: Commit and Push
run: |
git config --global user.email $GIT_EMAIL
git config --global user.name $GIT_NAME
git add .
git commit -m "Update CIDR lists"
git push