Skip to content

feat(ci): notify Telegram when a pull request is opened#77

Merged
ViktorSvertoka merged 1 commit into
developfrom
feat/github-actions
Dec 22, 2025
Merged

feat(ci): notify Telegram when a pull request is opened#77
ViktorSvertoka merged 1 commit into
developfrom
feat/github-actions

Conversation

@ViktorSvertoka
Copy link
Copy Markdown
Member

@ViktorSvertoka ViktorSvertoka commented Dec 22, 2025

Telegram notifications for Pull Requests

What was done

  • Added GitHub Actions workflow to send a Telegram notification when a Pull Request is created.
  • Integrated Telegram Bot API using repository secrets.
  • Notifications are sent automatically to the DevLovers Team chat.

How it works

  • On pull_request: opened event, GitHub Actions triggers a workflow.
  • The workflow sends a message to the Telegram group with:
    • repository name
    • PR author
    • PR title
    • source and target branches
    • direct link to the PR

Why

This improves team visibility and communication by instantly notifying the team about new Pull Requests without needing to check GitHub manually.

How to test

  1. Create a new branch.
  2. Open a Pull Request.
  3. Verify that a notification appears in the DevLovers Team Telegram chat.

Notes

  • Secrets TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID are configured at the repository level.
  • No changes to existing CI or branch protection rules were required.

Summary by CodeRabbit

  • Chores
    • Enhanced development workflow automation with improved pull request notifications.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 22, 2025

Deploy Preview for develop-devlovers ready!

Name Link
🔨 Latest commit 0a14fd0
🔍 Latest deploy log https://app.netlify.com/projects/develop-devlovers/deploys/69496379db201c00087e7ffa
😎 Deploy Preview https://deploy-preview-77--develop-devlovers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 22, 2025

Walkthrough

A GitHub Actions workflow file was added to send Telegram notifications when pull requests are opened. The workflow runs on ubuntu-latest, uses the appleboy/telegram-action@v1.0.1 action, and includes PR metadata such as repository, author, title, branches, and link in the notification message.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
​.github/workflows/telegram-pr-opened.yml
New workflow that triggers on PR opened events and sends Telegram notification with PR details using repository secrets for bot token and chat ID

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify secrets are correctly referenced (TELEGRAM_BOT_TOKEN, TELEGRAM_TO)
  • Confirm webhook action version and syntax

Poem

🐰 A workflow so fine, now hops and will chime,
When PRs arrive, a quick message in time!
With Telegram pinging, secrets held tight,
Our notifications now flutter just right! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding a GitHub Actions workflow to notify Telegram when a pull request is opened.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/github-actions

Comment @coderabbitai help to get the list of available commands and usage tips.

@ViktorSvertoka ViktorSvertoka merged commit 4866878 into develop Dec 22, 2025
5 of 6 checks passed
@ViktorSvertoka ViktorSvertoka deleted the feat/github-actions branch December 22, 2025 15:30
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/telegram-pr-opened.yml (2)

16-25: Message format is well-structured and informative!

The notification message includes all relevant PR information with clear formatting. The use of emojis enhances readability.

Optionally, you could use github.event.pull_request.user.login instead of github.actor for more explicit author identification:

🔎 Optional refinement for author field
-                    👤 Author: ${{ github.actor }}
+                    👤 Author: ${{ github.event.pull_request.user.login }}

This is more explicit, though both should yield the same result for the opened event.


11-12: Consider adding error handling for resilience.

If a Telegram notification failure shouldn't block PR workflows, consider adding continue-on-error: true to the step.

🔎 Optional error handling
             - name: Send Telegram message
+              continue-on-error: true
               uses: appleboy/telegram-action@v1.0.1

This ensures that if the Telegram service is temporarily unavailable, it won't prevent PR processing.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48f0a1d and 0a14fd0.

📒 Files selected for processing (1)
  • .github/workflows/telegram-pr-opened.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - develop-devlovers
  • GitHub Check: Header rules - develop-devlovers
  • GitHub Check: Pages changed - develop-devlovers
🔇 Additional comments (1)
.github/workflows/telegram-pr-opened.yml (1)

3-5: Trigger configuration looks good!

The workflow correctly triggers on the pull_request opened event as intended.

Comment on lines +7 to +15
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Telegram message
uses: appleboy/telegram-action@v1.0.1
with:
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
to: ${{ secrets.TELEGRAM_CHAT_ID }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Pin action to commit SHA for immutability.

The workflow uses appleboy/telegram-action@v1.0.1. Pinning an action to a full-length commit SHA is currently the only way to use an action as an immutable release. Consider updating to pin by SHA instead of the version tag to protect against potential tag tampering.

Additionally, add explicit read-only permissions:

 jobs:
     notify:
         runs-on: ubuntu-latest
+        permissions:
+            pull-requests: read
         steps:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Telegram message
uses: appleboy/telegram-action@v1.0.1
with:
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
to: ${{ secrets.TELEGRAM_CHAT_ID }}
jobs:
notify:
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Send Telegram message
uses: appleboy/telegram-action@v1.0.1
with:
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
to: ${{ secrets.TELEGRAM_CHAT_ID }}
🤖 Prompt for AI Agents
.github/workflows/telegram-pr-opened.yml lines 7-15: pin the third-party action
to a full commit SHA instead of the tag and add explicit minimal read-only
permissions; replace uses: appleboy/telegram-action@v1.0.1 with the action
reference that includes the full commit SHA (retrieve the commit SHA from the
appleboy/telegram-action repo and paste the full 40-char SHA), and add a
top-level permissions block with only the required read permissions (e.g.,
permissions: contents: read) to minimize access.

liudmylasovetovs pushed a commit that referenced this pull request Jan 9, 2026
feat(ci): notify Telegram when a pull request is opened
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.

1 participant