Skip to content

Action fix.

Action fix. #6

name: Telegram Notifications
on:
push:
branches:
- main
jobs:
send-telegram-notification:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install python-telegram-bot
- name: Send Telegram Notification
run: |
python -c "
import asyncio

Check failure on line 27 in .github/workflows/Telegram Notifications.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/Telegram Notifications.yml

Invalid workflow file

You have an error in your yaml syntax on line 27
from telegram import Bot
async def send_message():
bot = Bot(token='${{ secrets.TELEGRAM_BOT_TOKEN }}')
chat_id = '${{ secrets.TELEGRAM_CHANNEL_ID }}'
commit_link = '${{ github.event.head_commit.url }}'
await bot.send_message(chat_id=chat_id, text=f'New commit! {commit_link}')
asyncio.run(send_message())
"