Repository navigation
fix(telegram-notify): pass event data through env and disable link previews - #1
Merged
ImMohammad20000 merged 1 commit intoOct 9, 2026
Conversation
…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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the reusable Telegram notifier and makes its messages shorter.
env: the PR title, commit messages, actor and URLs now reach the script through environment variables instead of${{ }}expressions insiderun:. This follows GitHub's security hardening guide for untrusted input ("Using an intermediate environment variable").pull-requests: read, the only scope "List commits on a pull request" needs.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:The previous version fails these checks; this version passes all of them.