Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: publish release info on Discord #191

Merged
merged 1 commit into from
Oct 21, 2024
Merged

ci: publish release info on Discord #191

merged 1 commit into from
Oct 21, 2024

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Oct 21, 2024

Should be something like this:

Screenshot 2024-10-21 at 18 04 57

Summary by CodeRabbit

  • New Features
    • Introduced an automated workflow to send notifications to a Discord channel when a new release is published on GitHub, enhancing communication for users.

@fadeev fadeev requested review from andresaiello and a team as code owners October 21, 2024 15:04
Copy link
Contributor

coderabbitai bot commented Oct 21, 2024

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow file named release-to-discord.yaml has been added to automate notifications to Discord upon the publication of new releases on GitHub. This workflow is triggered by the release event when a release is published. It includes a job that checks out the repository and sends a message to a Discord channel using a specified webhook URL and other configuration parameters.

Changes

File Change Summary
.github/workflows/release-to-discord.yaml Added a new workflow to send notifications to Discord when a new release is published on GitHub.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub
    participant Discord

    GitHub->>GitHub: Release published
    GitHub->>GitHub: Trigger workflow
    GitHub->>GitHub: Checkout repository
    GitHub->>Discord: Send notification via webhook
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 0

🧹 Outside diff range and nitpick comments (1)
.github/workflows/release-to-discord.yaml (1)

9-10: Consider updating to the latest version of actions/checkout

The workflow is currently using actions/checkout@v3. While this version works, it's recommended to use the latest version (v4) to benefit from any improvements or bug fixes.

Consider updating the checkout action:

- uses: actions/checkout@v3
+ uses: actions/checkout@v4
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 51b8705 and 04fb730.

📒 Files selected for processing (1)
  • .github/workflows/release-to-discord.yaml (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
.github/workflows/release-to-discord.yaml (3)

1-3: LGTM: Correct workflow trigger

The workflow is correctly set to trigger on the 'release' event, specifically for the 'published' type. This ensures that the Discord notification will be sent only when a new release is published.


5-7: LGTM: Well-defined job

The job is appropriately named 'github-releases-to-discord' and set to run on the latest Ubuntu runner, which is a good practice for most workflows.


11-19: Suggestions for Discord notification configuration

The configuration for the Discord notification looks good overall. Here are some suggestions for improvement:

  1. The max_description length of 4096 characters is quite long. Consider reducing it to ensure the message fits well in Discord channels.
  2. The avatar_url is hardcoded. Consider moving it to a repository secret or variable for easier updates.

To ensure the webhook URL is correctly set, run the following script:

If the script doesn't find the secret, please make sure to set it in the repository settings.

Copy link
Collaborator

@GMaiolo GMaiolo left a comment

Choose a reason for hiding this comment

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

LGTM

@fadeev fadeev merged commit 5b4730d into main Oct 21, 2024
5 checks passed
@fadeev fadeev deleted the discord-release branch October 21, 2024 15:13
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