Skip to content

Commit f89af07

Browse files
author
Adriano Sanges
committed
Update GitHub Actions and Telegram API to use environment variables for bot configuration
1 parent d09077d commit f89af07

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/run-project.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ jobs:
3333
echo "warehouse_name=${{ secrets.warehouse_name }}" > .env
3434
echo "motherduck_token=${{ secrets.motherduck_token }}" >> .env
3535
echo "scrape_url=${{ secrets.scrape_url }}" >> .env
36+
echo "telegram_bot_api_key=${{ secrets.telegram_bot_api_key }}" >> .env
37+
echo "chat_id=${{ secrets.chat_id }}" >> .env
38+
echo "chat_tag=${{ secrets.chat_tag }}" >> .env
3639
- name: Run Python Script
3740
env:
3841
warehouse_name: ${{ secrets.warehouse_name }}
3942
motherduck_token: ${{ secrets.motherduck_token }}
4043
scrape_url: ${{ secrets.scrape_url }}
44+
telegram_bot_api_key: ${{ secrets.telegram_bot_api_key }}
45+
chat_id: ${{ secrets.chat_id }}
46+
chat_tag: ${{ secrets.chat_tag }}
4147
run: |
4248
cd real-estate-etl
4349
uv run scan_properties.py

real-estate-etl/telegram_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33

44

5-
TELEGRAM_BOT_API_KEY = '6596026864:AAFkT1-yG7abTakVEgGeqfiNyA-2mE3dO20'
6-
chat_id = '-4799482591'
7-
chat_tag = '@affittinapoliadriano'
5+
TELEGRAM_BOT_API_KEY = os.getenv('TELEGRAM_BOT_API_KEY')
6+
chat_id = os.getenv('CHAT_ID')
7+
chat_tag = os.getenv('CHAT_TAG')
88
bot = telegram.Bot(TELEGRAM_BOT_API_KEY)
99

1010

0 commit comments

Comments
 (0)