Skip to content

chore: add pr-comments workflow with default messages #92

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

Merged
merged 1 commit into from
Mar 25, 2025

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
    • Introduced an automated system that posts informative comments on pull requests during key events (opening, marking ready for review, or closing) to enhance collaboration and streamline feedback.

Copy link

coderabbitai bot commented Mar 24, 2025

Walkthrough

A new GitHub Actions workflow file has been added to the repository. This workflow, triggered on pull request events (opened, ready for review, or closed), defines a job named pr-comments that calls an external auto-comments workflow from the RequestNetwork organization. The integration leverages a secret token (GH_PAT_AUTO_COMMENTS) for authentication, applying the default settings of the referenced auto-comments workflow.

Changes

File Change Summary
.github/workflows/pr-comments.yml Added a new GitHub Actions workflow triggered by PR events that invokes the external RequestNetwork/auto-comments workflow (pr-auto-comments.yml) using a secret token.

Sequence Diagram(s)

sequenceDiagram
    participant U as User/PR Event
    participant GH as GitHub Actions
    participant AC as Auto-Comments Workflow

    U->>GH: Trigger event (PR opened/ready/closed)
    GH->>AC: Invoke pr-comments job with secret token
    AC-->>GH: Return auto-generated comments
    GH-->>U: Post comment to PR
Loading

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 self-assigned this Mar 24, 2025
@MantisClone MantisClone linked an issue Mar 24, 2025 that may be closed by this pull request
@MantisClone MantisClone marked this pull request as ready for review March 24, 2025 18:40
Copy link

@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

🧹 Nitpick comments (1)
.github/workflows/pr-comments.yml (1)

7-10: Job Definition and External Workflow Usage.
The job named pr-comments is set up correctly to leverage the external auto-comments workflow from the RequestNetwork repository. For increased stability and reproducibility, consider pinning the external workflow to a specific commit hash rather than using the main branch.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c107bcc and a076cec.

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

1-2: Workflow Name is Clear and Concise.
The workflow name “PR Comments” immediately communicates its purpose.


3-6: Event Triggers are Configured Correctly.
The use of the pull_request_target event with types [opened, ready_for_review, closed] is appropriate for ensuring the workflow responds to the desired PR lifecycle events. Just ensure this event type aligns with your security and context requirements when handling external content.


11-13: Input Parameters are Clear.
The with section clearly sets the org_name parameter and includes an inline comment indicating the use of default comments. This makes the configuration self-explanatory for maintainers.


14-15: Secrets Configuration is Properly Handled.
The secrets section correctly references the GH_PAT_AUTO_COMMENTS token via GitHub Actions secrets. Ensure that the secret has the appropriate permissions and that it is managed securely in your repository settings.

@MantisClone MantisClone enabled auto-merge (squash) March 24, 2025 20:14
@MantisClone MantisClone merged commit 0e4d7e1 into main Mar 25, 2025
1 check 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