site: block Copilot bot、renovate bot、dependa bot (#55150)

* site: block Copilot bot

* update

* update

* update

* update
This commit is contained in:
lijianan
2025-09-26 08:13:57 +08:00
committed by GitHub
parent bd1aa0114e
commit 1d433d59d5
4 changed files with 40 additions and 19 deletions

View File

@@ -9,7 +9,7 @@ interface ContributorAvatarProps {
const ContributorAvatar: React.FC<ContributorAvatarProps> = (props) => { const ContributorAvatar: React.FC<ContributorAvatarProps> = (props) => {
const { item: { username, url } = {} } = props; const { item: { username, url } = {} } = props;
if (username?.includes('github-actions')) { if (!username) {
return null; return null;
} }
return ( return (

View File

@@ -37,6 +37,9 @@ interface ContributorsProps {
filename?: string; filename?: string;
} }
// 这些机器人账号不需要展示
const blockList = ['github-actions', 'copilot', 'renovate', 'dependabot'];
const Contributors: React.FC<ContributorsProps> = ({ filename }) => { const Contributors: React.FC<ContributorsProps> = ({ filename }) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const { styles } = useStyle(); const { styles } = useStyle();
@@ -55,6 +58,7 @@ const Contributors: React.FC<ContributorsProps> = ({ filename }) => {
owner="ant-design" owner="ant-design"
fileName={filename} fileName={filename}
className={styles.list} className={styles.list}
filter={(item) => !blockList.some((name) => name === item?.username?.toLowerCase())}
renderItem={(item, loading) => ( renderItem={(item, loading) => (
<ContributorAvatar item={item} loading={loading} key={item?.url} /> <ContributorAvatar item={item} loading={loading} key={item?.url} />
)} )}
@@ -63,7 +67,7 @@ const Contributors: React.FC<ContributorsProps> = ({ filename }) => {
); );
}; };
const SuspenseContributors: React.FC<React.ComponentProps<typeof Contributors>> = (props) => ( const SuspenseContributors: React.FC<ContributorsProps> = (props) => (
<Suspense fallback={null}> <Suspense fallback={null}>
<Contributors {...props} /> <Contributors {...props} />
</Suspense> </Suspense>

View File

@@ -3,6 +3,7 @@
"07akioni", "07akioni",
"0xflotus", "0xflotus",
"17073025", "17073025",
"17hz",
"2724635499", "2724635499",
"282159468", "282159468",
"778758944", "778758944",
@@ -51,6 +52,7 @@
"Alexey Yakovlev", "Alexey Yakovlev",
"Alexis Hope", "Alexis Hope",
"Alfred Qiu", "Alfred Qiu",
"Ali Mahallati",
"Ali Zhdanov", "Ali Zhdanov",
"AliReza Kamkar", "AliReza Kamkar",
"AliRezaBeigy", "AliRezaBeigy",
@@ -219,6 +221,7 @@
"Dave", "Dave",
"David Broder-Rodgers", "David Broder-Rodgers",
"David Hatten", "David Hatten",
"David Hsing",
"David Schneider", "David Schneider",
"Davide Bianchi", "Davide Bianchi",
"Dawnlck", "Dawnlck",
@@ -294,6 +297,7 @@
"Eward Song", "Eward Song",
"FJHou", "FJHou",
"Fachreza Muslim", "Fachreza Muslim",
"FatahChan",
"Fatpandac", "Fatpandac",
"Federico Marcos", "Federico Marcos",
"Ferdi Koomen", "Ferdi Koomen",
@@ -322,6 +326,7 @@
"Gao Jiangmiao", "Gao Jiangmiao",
"Garrick Crouch", "Garrick Crouch",
"Gautier", "Gautier",
"GeoDaoyu",
"Geoff Holden", "Geoff Holden",
"Geoffrey Bell", "Geoffrey Bell",
"George Ciobanu", "George Ciobanu",
@@ -387,6 +392,7 @@
"Hughen", "Hughen",
"Hugo LEHMANN", "Hugo LEHMANN",
"Humble", "Humble",
"Hwansoo Kim",
"Hyunseok.Kim", "Hyunseok.Kim",
"ILdar Nogmanov", "ILdar Nogmanov",
"Ideveloper (이승규)", "Ideveloper (이승규)",
@@ -701,6 +707,7 @@
"Mr.Biscuit", "Mr.Biscuit",
"Mr.Tone", "Mr.Tone",
"Mr.jiangzhiguo", "Mr.jiangzhiguo",
"MrWangJustToDo",
"Ms. Wang", "Ms. Wang",
"MuYu", "MuYu",
"Muhammad Abuzar", "Muhammad Abuzar",
@@ -822,7 +829,6 @@
"Reed Sun", "Reed Sun",
"Regan Langford", "Regan Langford",
"Renny Ren", "Renny Ren",
"Renovate Bot",
"Rex", "Rex",
"Rex Zeng", "Rex Zeng",
"Ricardo Morais", "Ricardo Morais",
@@ -945,6 +951,7 @@
"Taucher Christoph", "Taucher Christoph",
"Taylor Sabell", "Taylor Sabell",
"Ted Shin", "Ted Shin",
"Teimur Gasanov",
"Teng YANG", "Teng YANG",
"Tengjiao Cai", "Tengjiao Cai",
"Terence", "Terence",
@@ -1062,6 +1069,7 @@
"Yee", "Yee",
"Yevhen Hryhorevskyi", "Yevhen Hryhorevskyi",
"Yiming", "Yiming",
"Yingtao Mo",
"Yogesh", "Yogesh",
"Yu", "Yu",
"Yu Mao", "Yu Mao",
@@ -1181,6 +1189,7 @@
"chenxiang", "chenxiang",
"chenxiaochun", "chenxiaochun",
"chequerNoel", "chequerNoel",
"chimobi-justice",
"chisus", "chisus",
"chunlea", "chunlea",
"cieldon32", "cieldon32",
@@ -1207,7 +1216,6 @@
"decade", "decade",
"delesseps", "delesseps",
"denzw", "denzw",
"dependabot[bot]",
"desperado", "desperado",
"detailyang", "detailyang",
"devqin", "devqin",
@@ -1251,6 +1259,7 @@
"gin-lsl", "gin-lsl",
"godfather", "godfather",
"gregahren", "gregahren",
"gregor-mueller",
"gxvv", "gxvv",
"gyh9457", "gyh9457",
"gzq", "gzq",
@@ -1290,6 +1299,7 @@
"ibrahim velinov", "ibrahim velinov",
"ice", "ice",
"imosapatryk", "imosapatryk",
"inottn",
"int2d", "int2d",
"iojichervo", "iojichervo",
"iola1999", "iola1999",
@@ -1352,6 +1362,7 @@
"lalalazero", "lalalazero",
"lamvananh", "lamvananh",
"leadream", "leadream",
"legend80s",
"lehug", "lehug",
"leijingdao", "leijingdao",
"leixd1994", "leixd1994",
@@ -1443,7 +1454,9 @@
"qi gao", "qi gao",
"qianbin", "qianbin",
"qiaojie", "qiaojie",
"qinware",
"qiqiboy", "qiqiboy",
"qixian",
"qliu", "qliu",
"qqabcv520", "qqabcv520",
"qramilq", "qramilq",
@@ -1549,6 +1562,7 @@
"wving5", "wving5",
"wwwxy", "wwwxy",
"wx1322", "wx1322",
"x1ngYu",
"xiaofan2406", "xiaofan2406",
"xiaofine1122", "xiaofine1122",
"xiaohuoni", "xiaohuoni",
@@ -1635,11 +1649,13 @@
"°))))彡", "°))))彡",
"Ömer Faruk APLAK", "Ömer Faruk APLAK",
"Đào Văn Hùng", "Đào Văn Hùng",
"Łukasz Komoszyński",
"Ștefan Filip", "Ștefan Filip",
"Зухриддин Камильжанов", "Зухриддин Камильжанов",
"रोहन मल्होत्रा", "रोहन मल्होत्रा",
"ᴡᴏɴᴋʏᴜɴɢ ᴍɪɴ", "ᴡᴏɴᴋʏᴜɴɢ ᴍɪɴ",
"一喵呜", "一喵呜",
"一步",
"丁文涛", "丁文涛",
"不吃猫的鱼", "不吃猫的鱼",
"丶尘殇", "丶尘殇",
@@ -1695,7 +1711,6 @@
"徐新航", "徐新航",
"愚道", "愚道",
"曾凯", "曾凯",
"期贤",
"未觉雨声", "未觉雨声",
"朮厃", "朮厃",
"李勇", "李勇",
@@ -1751,6 +1766,7 @@
"诸葛龙", "诸葛龙",
"谭真", "谭真",
"超能刚哥", "超能刚哥",
"达峰的夏天",
"迷渡", "迷渡",
"遇见同学", "遇见同学",
"那里好脏不可以", "那里好脏不可以",
@@ -1778,6 +1794,7 @@
"黑雨", "黑雨",
"龙风", "龙风",
"龚方闻", "龚方闻",
"강주혁(Juhyeok Kang)",
"𝑾𝒖𝒙𝒉", "𝑾𝒖𝒙𝒉",
"🏎️ Yumo" "🏎️ Yumo"
] ]

View File

@@ -5,6 +5,7 @@ import unionBy from 'lodash/unionBy';
import simpleGit from 'simple-git'; import simpleGit from 'simple-git';
const cwd = process.cwd(); const cwd = process.cwd();
const git = simpleGit(cwd); const git = simpleGit(cwd);
const excludes = [ const excludes = [
@@ -15,29 +16,28 @@ const excludes = [
'alipay.com', 'alipay.com',
'taobao.com', 'taobao.com',
'ant-design-bot', 'ant-design-bot',
'github-actions',
'copilot',
'renovate',
'renovate[bot]',
'dependabot',
'dependabot[bot]',
]; ];
async function execute() { async function execute() {
const logResult = await git.log(); const logResult = await git.log();
let all = logResult.all.filter(({ author_email: email }) => {
for (let i = 0; i < excludes.length; i++) { const filtered = logResult.all.filter(({ author_name, author_email }) => {
const item = excludes[i]; const name = author_name.toLowerCase();
if (email.includes(item)) { const email = author_email.toLowerCase();
return false; return !excludes.some((item) => email.includes(item) || name.includes(item));
}
}
return true;
}); });
all = sortBy(unionBy(all, 'author_email'), 'author_name'); const all = sortBy(unionBy(filtered, 'author_email'), 'author_name');
fs.writeFileSync( fs.writeFileSync(
path.join(cwd, 'contributors.json'), path.join(cwd, 'contributors.json'),
JSON.stringify( JSON.stringify(Array.from(new Set(all.map((authorItem) => authorItem.author_name))), null, 2),
Array.from(new Set<string>(all.map((authorItem) => authorItem.author_name))),
null,
2,
),
); );
} }