File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 const prNumber = context.payload.pull_request.number;
2020 const assignees = context.payload.pull_request.assignees;
2121
22+ // Technical Writers team members
23+ const techWriters = [
24+ 'ConnorLand',
25+ 'Karuna-Mendix',
26+ 'MariaShaposhnikova',
27+ 'MarkvanMents',
28+ 'NicoletaComan',
29+ 'OlufunkeMoronfolu',
30+ 'Yiyun333',
31+ 'dbreseman',
32+ 'katarzyna-koltun-mx',
33+ 'quinntracy'
34+ ];
35+
2236 console.log(`Processing PR #${prNumber} by ${creator}`);
2337 console.log(`Current assignees: ${assignees.length > 0 ? assignees.map(a => a.login).join(', ') : 'none'}`);
2438
@@ -27,23 +41,15 @@ jobs:
2741 return;
2842 }
2943
30- try {
31- console.log(`Checking if ${creator} is on technical-writers team...`);
32- await github.rest.teams.getMembershipForUserInOrg({
33- org: context.repo.owner,
34- team_slug: 'technical-writers',
35- username: creator
36- });
37-
38- console.log(`${creator} is on technical-writers team, assigning PR...`);
44+ if (techWriters.includes(creator)) {
45+ console.log(`${creator} is on technical writers team, assigning PR...`);
3946 await github.rest.issues.addAssignees({
4047 owner: context.repo.owner,
4148 repo: context.repo.repo,
4249 issue_number: prNumber,
4350 assignees: [creator]
4451 });
4552 console.log(`Successfully assigned PR #${prNumber} to ${creator}`);
46- } catch (error) {
47- console.log(`${creator} is not on technical-writers team, skipping assignment`);
48- console.log(`Error details: ${error.message}`);
53+ } else {
54+ console.log(`${creator} is not on technical writers team, skipping assignment`);
4955 }
You can’t perform that action at this time.
0 commit comments