diff --git a/.github/workflows/Telegram Notifications.yml b/.github/workflows/Telegram Notifications.yml index 5e37db9..dfe6b75 100644 --- a/.github/workflows/Telegram Notifications.yml +++ b/.github/workflows/Telegram Notifications.yml @@ -1,33 +1,39 @@ -name: Telegram Notifications + name: Telegram Notifications -on: - push: - branches: - - main + on: + push: + branches: + - main -jobs: - send-telegram-notification: - runs-on: ubuntu-latest + jobs: + send-telegram-notification: + runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 + steps: + - name: Checkout code + uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' - - name: Install Dependencies - run: pip install python-telegram-bot + - name: Install Dependencies + run: pip install python-telegram-bot - - name: Send Telegram Notification - run: | + - name: Send Telegram Notification + run: | python -c "import telegram; bot = telegram.Bot(token='BTID'); chat_id = 'NGTID'; bot.send_message(chat_id=chat_id, text='New commit! [commit link]')" env: BTID: ${{ secrets.TELEGRAM_BOT_TOKEN }} NGTID: ${{ secrets.TELEGRAM_CHANNEL_ID }} commit_link: ${{ github.event.commits[0].url }} - + - name: Delete sensitive data + run: | + rm -f ./secrets.txt + env: + secrets.TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + secrets.TELEGRAM_CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }} +