ci: add reusable workflow to comment on first-time PRs#43
Conversation
Our Pull Request Approval ProcessThis PR will be reviewed according to our: Your PR may be automatically closed if:
Thanks for contributing! |
|
Caution Review failedThe pull request is closed. WalkthroughA 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
|
PR validation failed: No linked issue and no valid closing issue reference in PR description |
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
.githubrepo 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
.githubrepository avoids duplication and allows repositories to opt in by referencing a single, maintained workflow.Implementation Details
.github/workflows/pull-request-comment.ymlas a reusableworkflow_callworkflowactions/github-scriptto detect whether the PR author has any previously merged pull requestsFollow-up
After this is merged, a small follow-up PR will reference this workflow from
talawa-admin’spull-request.yml.No breaking changes.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.