Files
finance-daily-site/.github/workflows/subscription-handler.yml
T
GJ d5d11f1a4a feat: add investment broadcast, subscription system & GoatCounter analytics
- scripts/daily-investment.py: Telegram 每日投资早报 (yfinance, 8 类别, 趋势分析)
- scripts/handle_subscriptions.py: Telegram bot 订阅处理器 (/subscribe /unsubscribe)
- data/investment-subscribers.json: 订阅者数据
- .github/workflows/investment-broadcast.yml: 每日 8:30 AM Toronto 推送
- .github/workflows/subscription-handler.yml: 每 30 分钟处理订阅请求
- index.html: 加入 Telegram 订阅按钮 + 订阅人数显示 + GoatCounter 统计
2026-05-03 14:25:47 -04:00

40 lines
981 B
YAML

name: Subscription Handler
on:
schedule:
# Every 30 minutes
- cron: '*/30 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
handle:
runs-on: ubuntu-latest
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install requests
- name: Process subscription updates
run: python scripts/handle_subscriptions.py
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/investment-subscribers.json data/telegram-offset.json
git diff --cached --quiet || git commit -m "chore: subscription update $(date -u +'%H:%M UTC')"
git push