diff --git a/.github/workflows/send-telegram-message.yml b/.github/workflows/send-telegram-message.yml deleted file mode 100644 index 51e0eba..0000000 --- a/.github/workflows/send-telegram-message.yml +++ /dev/null @@ -1,54 +0,0 @@ -# ============================================== -# Send Telegram Message -# ============================================== -# Reusable workflow for sending Telegram notifications - -name: Send Telegram Message - -on: - workflow_call: - inputs: - message: - required: true - type: string - description: 'Message text to send' - api_url: - required: true - type: string - description: 'Telegram API webhook URL' - chat_id: - required: true - type: string - description: 'Telegram chat ID to send the message to' - -jobs: - send-message: - name: Send Telegram Message - runs-on: ubuntu-latest - steps: - - name: Send Telegram notification - env: - MESSAGE_TEXT: ${{ inputs.message }} - CHAT_ID: ${{ inputs.chat_id }} - API_URL: ${{ inputs.api_url }} - run: | - payload=$(jq -n --arg text "$MESSAGE_TEXT" --arg chat_id "$CHAT_ID" '{chat_id: $chat_id, message: {text: $text}}') - - echo "Sending notification to Telegram..." - response=$(curl -s -w "\n%{http_code}" -X POST "$API_URL" \ - -H "Content-Type: application/json" \ - -d "$payload") - - http_code=$(echo "$response" | tail -n1) - body=$(echo "$response" | sed '$d') - - echo "Response status: $http_code" - echo "Response body: $body" - - if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]; then - echo "✅ Notification sent successfully!" - exit 0 - else - echo "❌ Failed to send notification (HTTP $http_code)" - exit 1 - fi