Skip to content

Commit 4bcc0d3

Browse files
committed
Sync auto-assign-pr.yml from .github repo
1 parent c6afab0 commit 4bcc0d3

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed
Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,33 @@
11
# Auto Assign Copilot (or any username) to every new pull request.
2-
32
# Tweak the username(s) below as needed!
43

54
name: Auto Assign Copilot to PRs
65

76
on:
8-
97
pull_request:
10-
118
types: [opened]
129

1310
jobs:
14-
1511
auto-assign:
16-
17-
runs-on: self-hosted
18-
12+
runs-on: [self-hosted, linux, x64, big]
1913
steps:
20-
2114
- name: Assign Copilot (or others) to new PRs
22-
2315
uses: actions/github-script@main
24-
2516
with:
26-
2717
github-token: ${{ secrets.GITHUB_TOKEN }}
28-
2918
script: |
30-
3119
// Assign PRs to Copilot or other users
32-
3320
const copilotUsername = "copilot"; // <-- TUNE ME!
34-
3521
const assignees = [copilotUsername]; // Or: ["copilot","anotheruser"]
36-
3722
const currentAssignees = context.payload.pull_request.assignees.map(u => u.login);
38-
3923
if (!assignees.every(a => currentAssignees.includes(a))) {
40-
4124
await github.rest.issues.addAssignees({
42-
4325
owner: context.repo.owner,
44-
4526
repo: context.repo.repo,
46-
4727
issue_number: context.payload.pull_request.number,
48-
4928
assignees
50-
5129
});
52-
5330
console.log(`Assigned ${assignees.join(", ")} to PR #${context.payload.pull_request.number}`);
54-
5531
} else {
56-
5732
console.log(`Already assigned: ${assignees.join(", ")} on PR #${context.payload.pull_request.number}`);
58-
59-
}
60-
33+
}

0 commit comments

Comments
 (0)