From 7d1682ac68e3e31e66129e13d7e9e3bef8f63e52 Mon Sep 17 00:00:00 2001 From: Janson1012 <1402225856@qq.com> Date: Wed, 28 Aug 2024 00:33:32 +0800 Subject: [PATCH 1/2] ci: fix verifyCommit --- scripts/verify-commit-msg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/verify-commit-msg.js b/scripts/verify-commit-msg.js index a5150a5f8e6..09bb0ac6df1 100644 --- a/scripts/verify-commit-msg.js +++ b/scripts/verify-commit-msg.js @@ -1,5 +1,5 @@ const chalk = require('chalk') -const msgPath = process.env.GIT_PARAMS +const msgPath = process.env.GIT_PARAMS || ".git/COMMIT_EDITMSG" const msg = require('fs').readFileSync(msgPath, 'utf-8').trim() const commitRE = From b1c709cae69427346a02771eb5c664216aa56a1e Mon Sep 17 00:00:00 2001 From: Janson1012 <1402225856@qq.com> Date: Wed, 28 Aug 2024 00:36:35 +0800 Subject: [PATCH 2/2] ci: delete useless ci code --- scripts/git-hooks/commit-msg | 14 -------------- scripts/git-hooks/pre-commit | 7 ------- 2 files changed, 21 deletions(-) delete mode 100755 scripts/git-hooks/commit-msg delete mode 100755 scripts/git-hooks/pre-commit diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg deleted file mode 100755 index d240e0b2647..00000000000 --- a/scripts/git-hooks/commit-msg +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Validate commit log -commit_regex='^Merge.+|(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|types)(\(.+\))?: .{1,50}' - -if ! grep -iqE "$commit_regex" "$1"; then - echo - echo " Error: proper commit message format is required for automated changelog generation." - echo - echo " - Use \`npm run commit\` to interactively generate a commit message." - echo " - See .github/COMMIT_CONVENTION.md for more details." - echo - exit 1 -fi diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit deleted file mode 100755 index 126d2ca400d..00000000000 --- a/scripts/git-hooks/pre-commit +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -files_to_lint=$(git diff --cached --name-only --diff-filter=ACM | grep '\.js$') - -if [ -n "$files_to_lint" ]; then - NODE_ENV=production eslint --quiet $files_to_lint -fi