Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 12, 2026

Summary

Adds a GitHub Actions workflow that automatically assigns Devin-created PRs to the user who requested the Devin session. When Devin opens a PR, the workflow parses the "Requested by" field from the PR description and assigns the PR to that GitHub user.

Handles two formats Devin uses:

  • Requested by: @username
  • Requested by: Full Name (@username)

Review & Testing Checklist for Human

  • Verify regex against actual PR bodies — spot-check a few recent Devin PRs to confirm the "Requested by" pattern matches. If Devin's description format varies (e.g. different whitespace, markdown formatting), the regex may silently fail to match.
  • Confirm permissions are sufficient — the workflow needs issues: write to call addAssignees. Verify this works with the org's GitHub Actions permission settings (Settings > Actions > General > Workflow permissions).
  • No error handling on the API call — if the extracted username is invalid or not a repo collaborator, the addAssignees call will throw. Consider whether a try/catch with a warning log is needed.

Test plan: After merging, trigger a new Devin session that creates a PR on this repo. Verify the workflow runs (check the Actions tab) and the PR gets assigned to the requesting user. Also verify it does not run on non-Devin PRs.

Notes

Summary by CodeRabbit

  • Chores
    • Implemented automated PR assignment for the Devin AI integration bot
    • Automatically routes pull requests to the appropriate user based on request information, improving workflow efficiency

Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

👋 @devin-ai-integration[bot]
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

A GitHub Actions workflow is introduced to automatically assign pull requests opened by the Devin AI integration bot. The workflow extracts a requesting user from the PR body using regex pattern matching and assigns that user to the PR, with logging for both successful and failed assignment attempts.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/assign-devin-prs.yml
New workflow that triggers on PRs opened by devin-ai-integration[bot], parses PR body with regex to extract a requesting user (@mention or parentheses format), and assigns that user to the PR via GitHub REST API with conditional logic and logging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit's rejoice, automation so fine,
Devin's PRs assigned in record time!
Regex hops through the body with glee,
Assigning the users, as quick as can be. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: introducing a GitHub Action workflow to auto-assign Devin-bot-created PRs to requesting users.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1770891201-auto-assign-devin-prs

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
.github/workflows/assign-devin-prs.yml (2)

22-29: Guard addAssignees with error handling to avoid failing the workflow.

If the requester is invalid or not a collaborator, addAssignees will throw and fail the job, preventing any logging about the actual issue.

🔧 Suggested error handling
-            if (user) {
-              await github.rest.issues.addAssignees({
-                owner: context.repo.owner,
-                repo: context.repo.repo,
-                issue_number: context.issue.number,
-                assignees: [user]
-              });
-              console.log(`Assigned PR #${context.issue.number} to @${user}`);
-            } else {
-              console.log('Could not determine requesting user from PR description');
-            }
+            if (!user) {
+              console.log('Could not determine requesting user from PR description');
+              return;
+            }
+            try {
+              await github.rest.issues.addAssignees({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                issue_number: context.issue.number,
+                assignees: [user]
+              });
+              console.log(`Assigned PR #${context.issue.number} to @${user}`);
+            } catch (err) {
+              console.warn(`Failed to assign PR #${context.issue.number} to @${user}: ${err?.message ?? err}`);
+            }

20-21: Make the requester regex more tolerant of formatting/casing variations.

The current pattern is case-sensitive and can be brittle with extra whitespace. A looser, case-insensitive match will reduce false negatives.

🔍 Suggested regex tweak
-            const match = body.match(/Requested by[:\s]*(?:@(\w[\w-]*)|[\w][\w\s]*\(@(\w[\w-]*)\))/);
+            const match = body.match(/Requested by[:\s]*(?:@([\w-]+)|[^(\n]*\(@([\w-]+)\))/i);

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

@haritamar haritamar self-assigned this Feb 12, 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