Skip to content

Conversation

@MantisClone
Copy link
Member

@MantisClone MantisClone commented Mar 24, 2025

Description

This Pull Request adds the pr-comments.yml workflow which posts customizable comments on Pull Requests submitted by external contributors (those outside the RequestNetwork organization).

The workflow leaves comments in these situations:

  • On a contributor's first Pull Request to your repository
  • When a Pull Request is marked as ready for review
  • When a Pull Request is merged

Details

It uses the GH_PAT_AUTO_COMMENTS organization secret which is a Personal Access Token provided by @MantisClone (me). Thus, the comments look like they're being posted by me.

Default messages

First PR Comment:

'Hello @{{username}}, thank you for submitting your first pull request to the {{repository}} repository. We value your contribution and encourage you to review our contribution guidelines to ensure your submission meets our standards. Please note that every merged PR is automatically enrolled in our Best PR Initiative, offering a chance to win $500 each quarter. Our team is available via GitHub Discussions or Discord if you have any questions. Welcome aboard!'

Ready for Review Comment:

'Thank you for your submission! As you prepare for the review process, please ensure that your PR title, description, and any linked issues fully comply with our contribution guidelines. A clear explanation of your changes and their context will help expedite the review process. Every merged PR is automatically entered into our Best PR Initiative, offering a chance to win $500 every quarter. We appreciate your attention to detail and look forward to reviewing your contribution!'

Merged Comment:

'Congratulations, your pull request has been merged! Thank you for your valuable contribution to Request Network. As a reminder, every merged PR is automatically entered into our Best PR Initiative, offering a quarterly prize of $500. Your work significantly supports our project''s growth, and we encourage you to continue engaging with our community. Additionally, if you want to build or add crypto payments and invoicing features, explore how our API can reduce deployment time from months to hours while offering advanced features. Book a call with our expert to learn more and fast-track your development.'

Test

This test pull request created by an external user shows 3 messages being sent at the appropriate times.

Context

Towards:

Considerations

  • Why not use an off-the-shelf action from the Github Actions Marketplace?
  • The pr-comments.yml workflow is installed using the @main tag so this repo will pull the latest default messages from the auto-comments repo as soon as they're merged to the main branch.

Reference

Summary by CodeRabbit

  • New Features
    • Added an automated workflow that posts standardized comments on pull requests when they’re opened, marked ready for review, or closed. This enhancement streamlines communication during the review process.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2025

Walkthrough

A new GitHub Actions workflow file (.github/workflows/pr-comments.yml) has been added. This workflow is triggered by pull request events (opened, marked as ready for review, or closed). It defines a job named pr-comments that leverages an external auto-comments workflow from the RequestNetwork/auto-comments repository. The workflow incorporates organization-specific details and uses a secret token for authentication.

Changes

File Change Summary
.github/workflows/pr-comments.yml Added a new workflow that triggers on pull request events (opened, ready for review, closed) and invokes an external auto-comments workflow using a secret token.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request Event
    participant GH as GitHub Actions Workflow
    participant AC as Auto-Comments Workflow
    participant Repo as GitHub PR

    PR->>GH: Trigger on PR open/ready/close event
    GH->>AC: Invoke auto-comments job (pr-auto-comments.yml)
    AC->>Repo: Post automated comment on PR
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e73e696 and b06ba98.

📒 Files selected for processing (1)
  • .github/workflows/pr-comments.yml (1 hunks)
🔇 Additional comments (3)
.github/workflows/pr-comments.yml (3)

1-2: Workflow Naming Clarity
The workflow is well-named as "PR Comments", which clearly indicates its purpose.


3-6: Trigger Configuration Validation
The workflow correctly triggers on pull_request_target events for the critical PR states (opened, ready_for_review, and closed). This should ensure that the auto-commenting is executed on key pull request events.


7-16: Job Configuration and External Workflow Integration
The job pr-comments is set up to use the external auto-comments workflow from RequestNetwork/auto-comments and is properly configured with the organization name and secret token. Please double-check that:

  • The secret GH_PAT_AUTO_COMMENTS is correctly set in your repository settings.
  • Using the workflow from the main branch of the external repository aligns with your versioning and stability requirements.
    Overall, the integration is clean and meets the PR objectives.

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
🪧 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 generate docstrings to generate docstrings for this 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@MantisClone MantisClone linked an issue Mar 24, 2025 that may be closed by this pull request
@MantisClone MantisClone enabled auto-merge (squash) March 24, 2025 21:01
@MantisClone MantisClone merged commit 0c80dea into main Mar 25, 2025
4 checks passed
@MantisClone MantisClone deleted the add-auto-comments branch March 25, 2025 07:36
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.

Deploy the "Best PR" Initiative

2 participants