-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (45 loc) · 1.63 KB
/
run_fdip.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
name: Run fdip.py
on:
schedule:
- cron: "10 * * * *" # 每小时的第10分钟执行
timezone: Asia/Shanghai # 添加时区配置
workflow_dispatch: # 允许手动触发
jobs:
run-tcip:
runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai # 设置为你本地的时区
permissions:
contents: write # 确保有权限推送代码
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10" # 根据需要调整Python版本
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # 确保requirements.txt包含所有依赖
pip install telethon python-dotenv pathlib2
- name: Set up environment variables
run: |
touch .env
echo "API_ID=${{ secrets.API_ID }}" >> .env
echo "API_HASH=${{ secrets.API_HASH }}" >> .env
echo "SESSION_NAME=${{ secrets.SESSION_NAME }}" >> .env
echo "TELEGRAM_PROXY=${{ secrets.TELEGRAM_PROXY }}" >> .env
- name: Run fdip.py
run: python fdip.py
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet; then
echo "No changes to commit."
else
git add .
git commit -m "cfst: Auto-update fdip.txt on $(date +'%Y-%m-%d %H:%M:%S')"
git push origin main
fi