Detect code review category based on GitHub url

This commit is contained in:
Rohid
2024-08-20 11:58:56 +06:00
parent 6ea75f1f75
commit fa5537a972
2 changed files with 19 additions and 2 deletions

View File

@@ -29,3 +29,14 @@ export const generateProjectFromDevSites = (url: string): string | null => {
return match?.[0] ?? null;
};
const CODE_REVIEW_URL_REG_LIST = [/github.com\/[^/]+\/[^/]+\/pull\/\d+\/files/];
export const isCodeReviewing = (url: string): boolean => {
for (const reg of CODE_REVIEW_URL_REG_LIST) {
if (url.match(reg)) {
return true;
}
}
return false;
};