Skip to content

Add workflow to manually test Telegram notification delivery - #2

Merged
John-Chan merged 2 commits into
mainfrom
copilot/add-telegram-test-workflow
Feb 25, 2026
Merged

Add workflow to manually test Telegram notification delivery#2
John-Chan merged 2 commits into
mainfrom
copilot/add-telegram-test-workflow

Conversation

Copilot AI commented Feb 25, 2026

Copy link
Copy Markdown

Adds a workflow_dispatch-only workflow to validate that the Telegram Bot API sendMessage integration works with the repository's configured secrets.

Changes

  • .github/workflows/telegram-test.yaml — new workflow with:
    • Manual trigger only (workflow_dispatch)
    • Skips the send step if TELEGRAM_BOT_TOKEN or TELEGRAM_CHAT_ID secrets are absent
    • Sends a plain-text message (no parse_mode) via curl to api.telegram.org/bot.../sendMessage
    • Message body includes repository, workflow name, run ID, triggering actor, and UTC timestamp
- name: Send Telegram test message
  if: ${{ env.TELEGRAM_BOT_TOKEN != '' && env.TELEGRAM_CHAT_ID != '' }}
  run: |
    curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
      -d chat_id="${TELEGRAM_CHAT_ID}" \
      -d text="[TEST] Telegram notification test
Repository: ${{ github.repository }}
Workflow: ${{ github.workflow }}
Run ID: ${{ github.run_id }}
Triggered by: ${{ github.actor }}
Timestamp: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"

No existing workflows are modified.

Original prompt

Create a new GitHub Actions workflow in the repository power4j/docker-mirror whose purpose is to test Telegram notifications and validate that the Telegram send code works. The workflow must be manually triggerable.

Requirements:

  1. Add a new workflow file under .github/workflows/ (choose a clear name like telegram-test.yaml).
  2. Trigger: workflow_dispatch.
  3. The job should send a plain-text Telegram message using the same mechanism as the mirror workflow PR: call Telegram Bot API sendMessage via curl.
  4. Use repository secrets TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID.
  5. Gate execution so the step/job does not run (or is skipped) if secrets are missing, similar to: if: ${{ env.TELEGRAM_BOT_TOKEN != '' && env.TELEGRAM_CHAT_ID != '' }}.
  6. The message content should clearly indicate it is a test message and include helpful context such as repository, workflow name, run id, and timestamp (use GitHub Actions context vars where possible). Keep it plain text (no parse_mode).
  7. Do not modify existing workflows beyond adding this new file.

Deliverable:

  • Open a pull request adding the new workflow file.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: John-Chan <2360910+John-Chan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow for Telegram notifications test Add workflow to manually test Telegram notification delivery Feb 25, 2026
Copilot AI requested a review from John-Chan February 25, 2026 05:55
@John-Chan
John-Chan marked this pull request as ready for review February 25, 2026 06:03
@John-Chan
John-Chan merged commit 03fb994 into main Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants