From 4f416c64b1fde697e679957e5226cf80d8b405cb Mon Sep 17 00:00:00 2001 From: vagusX Date: Tue, 11 Jul 2023 23:36:34 +0800 Subject: [PATCH] scripts: update check-commit (#43491) Co-authored-by: taian.lta --- scripts/check-commit.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/check-commit.ts b/scripts/check-commit.ts index 71f55bdb4d..1e8773ec6b 100644 --- a/scripts/check-commit.ts +++ b/scripts/check-commit.ts @@ -57,11 +57,16 @@ async function checkCommit({ files }: StatusResult) { async function checkRemote() { try { const { remote } = await git.fetch('origin', 'master'); + console.log(chalk.blue('⛳ Checking origin master with `git fetch origin master`')); if (!remote?.includes('ant-design/ant-design')) { - console.log( - chalk.yellow('😓 Your remote origin is not ant-design/ant-design, did you fork it?'), - ); - exitProcess(); + console.log(chalk.blue('⛳ Checking locally with `git config --get remote.origin.url`')); + const { value } = await git.getConfig('remote.origin.url'); + if (!value?.includes('ant-design/ant-design')) { + console.log( + chalk.yellow('🧐 Your remote origin is not ant-design/ant-design, did you fork it?'), + ); + exitProcess(); + } } } catch { console.log(chalk.red('🚨 Check remote failed. Skip...'));