40 lines
981 B
YAML
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
|