tisonkun commented on code in PR #4001:
URL: 
https://github.com/apache/incubator-opendal/pull/4001#discussion_r1455027478


##########
.github/scripts/assign_reviewers.js:
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+async function run(github, context, core, fs) {
+  try {
+    // Pick two reviewers from list
+    const numberOfReviewers = 2;
+    const repo = context.repo;
+
+    // Read CODEOWNERS
+    const codeownersContent = fs.readFileSync('.github/CODEOWNERS', 'utf8');
+    const lines = codeownersContent.split('\n');
+
+    // Search COMMITTERS
+    const placeholderLine = lines.find(line => 
line.startsWith('COMMITTERS_PLACEHOLDER'));
+    if (!placeholderLine) {
+      throw new Error("No COMMITTERS found in CODEOWNERS");
+    }
+
+    // Extract committers from placeholder line
+    const committers = placeholderLine.match(/@[\w-]+/g).map(u => 
u.substring(1));

Review Comment:
   Weird parsing. If we don't use CODEOWNER native function, why not simply 
configure a JS array:
   
   ```js
   const candidate = [
     "Xuanwo",
     "Ji-Xinyou",
     ...
   ];
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to