-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (48 loc) · 1.74 KB
/
main.yml
File metadata and controls
54 lines (48 loc) · 1.74 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: Fetch V2Ray Config
on:
schedule:
- cron: "*/30 * * * *"
workflow_dispatch:
jobs:
update-configs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install telethon requests
- name: Run script
env:
TELEGRAM_SESSION_STRING: ${{ secrets.TELEGRAM_SESSION_STRING }}
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
run: |
python FetchConfig.py
- name: Commit and push changes
run: |
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git add Config/vless.txt || true
git add Config/vmess.txt || true
git add Config/shadowsocks.txt || true
git add Config/trojan.txt || true
git add Config/HamrahAval.txt || true
git add Config/Irancell.txt || true
git add Config/Makhaberat.txt || true
git add Config/Samantel.txt || true
git add Config/Shatel.txt || true
git add Config/proxies.txt || true
git add Logs/channel_stats.json || true
git add Logs/invalid_channels.txt || true
git add Logs/collector.log || true
git add telegram_channels.json || true
git add FetchConfig.py || true
git commit -m "Update configs 🚀" || echo "No changes to commit"
git push || echo "Failed to push changes, check permissions"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}