File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Auto-assign Devin PRs
2+
3+ on :
4+ pull_request :
5+ types : [opened]
6+
7+ jobs :
8+ assign :
9+ if : github.actor == 'devin-ai-integration[bot]'
10+ runs-on : ubuntu-latest
11+ permissions :
12+ pull-requests : write
13+ issues : write
14+ steps :
15+ - name : Extract and assign requesting user
16+ uses : actions/github-script@v7
17+ with :
18+ script : |
19+ const body = context.payload.pull_request.body || '';
20+ const match = body.match(/Requested by[:\s]*(?:@(\w[\w-]*)|[\w][\w\s]*\(@(\w[\w-]*)\))/);
21+ const user = match?.[1] || match?.[2];
22+ if (user) {
23+ await github.rest.issues.addAssignees({
24+ owner: context.repo.owner,
25+ repo: context.repo.repo,
26+ issue_number: context.issue.number,
27+ assignees: [user]
28+ });
29+ console.log(`Assigned PR #${context.issue.number} to @${user}`);
30+ } else {
31+ console.log('Could not determine requesting user from PR description');
32+ }
You can’t perform that action at this time.
0 commit comments