Skip to content

Added newpart label filtering for Discord Notifications#282

Merged
sai-kaushik-s merged 1 commit into
codenet:mainfrom
Yash-Rawat-IIT-D:main-discord-int-new
May 9, 2026
Merged

Added newpart label filtering for Discord Notifications#282
sai-kaushik-s merged 1 commit into
codenet:mainfrom
Yash-Rawat-IIT-D:main-discord-int-new

Conversation

@Yash-Rawat-IIT-D

Copy link
Copy Markdown
Contributor

PR: Add Label-Based Filtering for Discord Notifications

Summary

Enhances the GitHub → Discord notification workflow by ensuring notifications are sent only when a pull request is merged and contains the newpart label.

Changes

  • Added PR_LABELS environment variable using toJson(github.event.pull_request.labels)
  • Parsed labels in notify.py using json.loads
  • Added guard clause to exit if newpart label is not present
  • Retained existing merged check logic

Behavior

  • Notify only if PR is merged
  • Notify only if PR has newpart label
  • Allows additional labels without restriction

Rationale

Reduces noise and ensures notifications are limited to relevant, labeled changes.

Reference

https://stackoverflow.com/questions/62325286/run-github-actions-when-pull-requests-have-a-specific-label
https://stackoverflow.com/questions/71481086/is-pull-request-label-available-to-a-github-action

@sai-kaushik-s sai-kaushik-s merged commit a43feaa into codenet:main May 9, 2026
sai-kaushik-s pushed a commit that referenced this pull request May 9, 2026
@sai-kaushik-s sai-kaushik-s added Spring2026 PR made be Spring 2026 students, possibly for errata participation. bug/fix Fix something that is not working. Misc and removed bug/fix Fix something that is not working. Misc labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug/fix Fix something that is not working. Spring2026 PR made be Spring 2026 students, possibly for errata participation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants