Skip to content

Refactor auto-merge workflow for trusted contributors - #2410

Open
jeniferalaquoke wants to merge 1 commit into
Canopus-Labs:mainfrom
jeniferalaquoke:patch-1
Open

jeniferalaquoke wants to merge 1 commit into
Canopus-Labs:mainfrom
jeniferalaquoke:patch-1

Conversation

@jeniferalaquoke

@jeniferalaquoke jeniferalaquoke commented Nov 13, 2026 •

Copy link
Copy Markdown

Automates the labeling of pull requests submitted by trusted contributors using GitHub Actions. Automatically creates missing repository labels and applies predefined GSSoC approval, priority, merge readiness, quality, and contribution type labels to eligible pull requests. Supports automatic labeling through pull request events and manual backfilling of existing open PRs while skipping draft PRs and untrusted contributors. Ensures consistent PR organization and simplifies contribution management without performing automatic merges.

📝 Pull Request Description

Related Issue

Closes #

Summary

Provide a short, reviewer-friendly summary of what changed and why.


Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature
  • ♻️ Refactoring
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔥 Other(please describe) ______

How Has This Been Tested?

Describe the testing steps performed.


Screenshots (if applicable)

Add screenshots or videos to demonstrate the changes.


Checklist

  • My code follows the project's guidelines
  • I have tested my changes
  • I have updated documentation where necessary
  • I have linked the related issue
  • My changes do not introduce new warnings or errors

This change refactors the GitHub Actions workflow .github/workflows/auto-merge-trusted.yml. It is the only file changed (+122/-94). The workflow labels pull requests from trusted contributors. It does not merge pull requests.

Changes:

  • Label creation: ensureLabels() checks each required label with getLabel.
    • If the label is missing (404), it calls createLabel.
    • If creation returns 422, the code calls getLabel again to confirm that another run created the label.
    • Any other lookup or creation error is thrown.
    • Some label descriptions are reworded, for example quality:exceptional now reads "Exceptional quality contribution".
  • Label names: labelNames is computed once from LABELS. labelPR uses it when it calls addLabels.
  • Trust check: A new isTrusted(author) helper compares the lowercased author name with TRUSTED. Both the manual and event paths use it.
  • Manual backfill (workflow_dispatch): The code fetches open pull requests with github.paginate instead of a manual while loop. Draft pull requests and untrusted authors are skipped. The remaining trusted pull requests are labeled.
  • Event trigger: If context.payload.pull_request is missing, the step calls core.setFailed and returns.
  • Logging: Log messages are reworded. The final messages state that the labeling workflow completed and that no automatic merge operation was performed.
  • Cosmetic edits: The job name changes to "Add Trusted Contributor Labels" and the step name changes to "Add required labels to trusted PRs". A blank line is added at the top of the file and before workflow_dispatch. The inline comment on workflow_dispatch is removed.

Testing: The PR description does not state any tests. No workflow run results were available for this review.

Automates the labeling of pull requests submitted by trusted contributors using GitHub Actions. Automatically creates missing repository labels and applies predefined GSSoC approval, priority, merge readiness, quality, and contribution type labels to eligible pull requests. Supports automatic labeling through pull request events and manual backfilling of existing open PRs while skipping draft PRs and untrusted contributors. Ensures consistent PR organization and simplifies contribution management without performing automatic merges.
@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request, @jeniferalaquoke! 🙌
We'll review it as soon as possible.
If there are any specific instructions or feedback regarding your PR, we'll provide them here.
Thanks again for your contribution to our project! 😊

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workflow now supports manual backfill of open pull requests and event-driven labeling. It ensures labels exist, handles concurrent label creation, and reports errors when required pull-request data is missing.

Changes: Trusted pull request labeling

Layer / File(s) Summary
Workflow triggers and label setup
.github/workflows/auto-merge-trusted.yml
Adds manual dispatch and defines labels. The workflow creates labels when lookup returns 404, handles a concurrent creation response of 422, and throws other lookup or creation errors.
Manual and event-driven processing
.github/workflows/auto-merge-trusted.yml
Manual backfill uses github.paginate to scan open pull requests and skips drafts and untrusted authors. Event processing reports missing pull-request data, skips untrusted authors, and labels eligible pull requests.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as GitHub Actions workflow
  participant API as GitHub API
  Workflow->>API: Paginate open pull requests
  API-->>Workflow: Return pull requests
  Workflow->>Workflow: Skip drafts and untrusted authors
  Workflow->>API: Apply labels to eligible pull requests
  API-->>Workflow: Return labeling result
Loading

Suggested reviewers: karanunique

Merge Risk: Minimal · up to 6e390

This workflow only labels eligible pull requests from trusted contributors and does not merge anything. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: refactoring the auto-merge workflow for trusted contributors. The raw summary shows the workflow now creates missing labels, handles concurrent label creation, paginat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: refactoring the auto-merge workflow for trusted contributors. The raw summary shows the workflow now creates missing labels, handles concurrent label creation, paginates backfill, and labels trusted PRs. The title is partially accurate because the change is a label-focused refactor, and the workflow name still says auto-merge while the PR states it performs no automatic merges. This is a mismatch in naming, not an unrelated title.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments, ai_padded_prose). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e3a36997-f32e-49fa-83ee-a2758a3cbc59
Commits

Reviewing files that changed from the base of the PR and between a8d14cf and 6e3903d.

Files selected for processing: 1

  • .github/workflows/auto-merge-trusted.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added the merge ready PR is mergeable and has no conflicts label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready PR is mergeable and has no conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant