Skip to content

fix(telegram-notify): pass event data through env and disable link previews - #1

Merged
ImMohammad20000 merged 1 commit into
PasarGuard:mainfrom
T3ST3ST3R0N:fix/telegram-notify-env-and-previews
Oct 9, 2026
Merged

ImMohammad20000 merged 1 commit into
PasarGuard:mainfrom
T3ST3ST3R0N:fix/telegram-notify-env-and-previews

Conversation

@T3ST3ST3R0N

@T3ST3ST3R0N T3ST3ST3R0N commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hardens the reusable Telegram notifier and makes its messages shorter.

  • Event data through env: the PR title, commit messages, actor and URLs now reach the script through environment variables instead of ${{ }} expressions inside run:. This follows GitHub's security hardening guide for untrusted input ("Using an intermediate environment variable").
  • Read-only token: the job's token is limited to pull-requests: read, the only scope "List commits on a pull request" needs.
  • No link previews: link_preview_options={"is_disabled":true} is sent, so notifications no longer expand a large preview card.

No behaviour change otherwise: same message format, targets, topic ids, truncation and error handling.

Testing

I ran the step's bash locally with a fake curl, expanding the ${{ }} expressions the same way Actions does, for three events: a PR opened, a push, and a PR merged. I checked:

  • that titles and commit messages containing shell syntax stay plain text;
  • the HTML sent to Telegram;
  • that link previews are disabled;
  • the permissions block.

The previous version fails these checks; this version passes all of them.

…eviews

Event values (PR title, commit messages, actor, URLs) now reach the script
through environment variables instead of ${{ }} expressions inside run:,
as GitHub's security hardening guide recommends for untrusted input.

The job token is limited to read access, since the job only reads the PR's
commits. Link previews are disabled so notifications stay short.
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbf3c8f0-c4ed-434e-aa25-7f916937740c

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ImMohammad20000
ImMohammad20000 merged commit 791d5ac into PasarGuard:main Oct 9, 2026
1 check passed
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