Skip to content

Commit 9371f8c

Browse files
author
Your Name
committed
D
1 parent 2bc0e01 commit 9371f8c

17 files changed

+3140
-0
lines changed

.bish.sqlite

564 KB
Binary file not shown.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Auto Assign Copilot (or any username) to every new pull request.
2+
# Tweak the username(s) below as needed!
3+
4+
name: Auto Assign Copilot to PRs
5+
6+
on:
7+
pull_request:
8+
types: [opened]
9+
10+
jobs:
11+
auto-assign:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Assign Copilot (or others) to new PRs
15+
uses: actions/github-script@main
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
script: |
19+
// Assign PRs to Copilot or other users
20+
const copilotUsername = "copilot"; // <-- TUNE ME!
21+
const assignees = [copilotUsername]; // Or: ["copilot","anotheruser"]
22+
const currentAssignees = context.payload.pull_request.assignees.map(u => u.login);
23+
if (!assignees.every(a => currentAssignees.includes(a))) {
24+
console.log(`PR has assignees to add. Attempting to assign ${assignees.join(", ")}...`);
25+
26+
try {
27+
await github.rest.issues.addAssignees({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
issue_number: context.payload.pull_request.number,
31+
assignees
32+
});
33+
console.log(`✅ Assigned ${assignees.join(", ")} to PR #${context.payload.pull_request.number}`);
34+
} catch (error) {
35+
console.log(`⚠️ Failed to assign users: ${error.message}`);
36+
console.log("Note: This may be due to insufficient permissions or the user not being a collaborator.");
37+
}
38+
} else {
39+
console.log(`ℹ️ Already assigned: ${assignees.join(", ")} on PR #${context.payload.pull_request.number}`);
40+
}

0 commit comments

Comments
 (0)