Browse Source

scripts: update check-commit (#43491)

Co-authored-by: taian.lta <taian.lta@antgroup.com>
pull/43496/head
vagusX 1 year ago
committed by GitHub
parent
commit
4f416c64b1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      scripts/check-commit.ts

13
scripts/check-commit.ts

@ -57,11 +57,16 @@ async function checkCommit({ files }: StatusResult) {
async function checkRemote() { async function checkRemote() {
try { try {
const { remote } = await git.fetch('origin', 'master'); 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')) { if (!remote?.includes('ant-design/ant-design')) {
console.log( console.log(chalk.blue('⛳ Checking locally with `git config --get remote.origin.url`'));
chalk.yellow('😓 Your remote origin is not ant-design/ant-design, did you fork it?'), const { value } = await git.getConfig('remote.origin.url');
); if (!value?.includes('ant-design/ant-design')) {
exitProcess(); console.log(
chalk.yellow('🧐 Your remote origin is not ant-design/ant-design, did you fork it?'),
);
exitProcess();
}
} }
} catch { } catch {
console.log(chalk.red('🚨 Check remote failed. Skip...')); console.log(chalk.red('🚨 Check remote failed. Skip...'));

Loading…
Cancel
Save