Skip to content

ci: add reusable workflow to comment on first-time PRs#43

Closed
kushu30 wants to merge 1 commit into
PalisadoesFoundation:mainfrom
kushu30:feat/first-pr-comment-action
Closed

ci: add reusable workflow to comment on first-time PRs#43
kushu30 wants to merge 1 commit into
PalisadoesFoundation:mainfrom
kushu30:feat/first-pr-comment-action

Conversation

@kushu30

@kushu30 kushu30 commented Jan 30, 2026

Copy link
Copy Markdown
Member

Summary

Adds a reusable GitHub Actions workflow that comments on a contributor’s first pull request if they have no previously merged PRs in the repository. This workflow is designed to live in the .github repo and be referenced from individual project PR pipelines (for example, talawa-admin/.github/workflows/pull-request.yml).

Motivation

Multiple PalisadoesFoundation repositories require consistent contributor onboarding behavior. Centralizing this logic in the .github repository avoids duplication and allows repositories to opt in by referencing a single, maintained workflow.

Implementation Details

  • Introduces .github/workflows/pull-request-comment.yml as a reusable workflow_call workflow
  • Uses actions/github-script to detect whether the PR author has any previously merged pull requests
  • Posts a single welcome comment only for first-time contributors
  • Does not trigger on its own and must be explicitly referenced by consuming repositories

Follow-up

After this is merged, a small follow-up PR will reference this workflow from talawa-admin’s pull-request.yml.

No breaking changes.

Summary by CodeRabbit

  • Chores
    • Added automated workflow to recognize and welcome first-time pull request contributors with a thank-you message and review acknowledgment.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions

Copy link
Copy Markdown

Our Pull Request Approval Process

This PR will be reviewed according to our:

  1. Palisadoes Contributing Guidelines

  2. AI Usage Policy

Your PR may be automatically closed if:

  1. Our PR template isn't filled in correctly
  2. You haven't correctly linked your PR to an issue

👉 https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue

Thanks for contributing!

@coderabbitai

coderabbitai Bot commented Jan 30, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

A new GitHub Actions workflow is introduced that detects first-time pull request contributors. The workflow retrieves the PR author, queries the repository's closed pull requests via pagination to verify merge history, and posts a welcome comment if the author has no previously merged pull requests.

Changes

Cohort / File(s) Summary
First PR Detection Workflow
.github/workflows/pull-request-comment.yml
New workflow triggered on workflow_call that uses GitHub Script to fetch PR author details, check closed PRs for prior merges, and post a welcome comment for first-time contributors.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as GitHub Actions
    participant Script as GitHub Script Action
    participant API as GitHub API
    participant PR as Pull Request

    Workflow->>Script: Trigger on workflow_call
    Script->>API: Fetch PR context
    API-->>Script: Return PR author & metadata
    Script->>API: Query closed PRs (paginated)
    API-->>Script: Return paginated PR list
    Script->>Script: Check if author has merged PRs
    alt First PR by author
        Script->>API: Post welcome comment
        API-->>PR: Comment added
    else Has prior merges
        Script->>Script: Skip comment
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new workflow hops into view,
Welcoming first-timers, tried and true!
Pagination checked, a comment is blessed,
To thank fresh contributors at their best. 🌟

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

PR validation failed: No linked issue and no valid closing issue reference in PR description

@github-actions github-actions Bot closed this Jan 30, 2026
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.

1 participant