chore: skip pre commit check for merge (#33287)

This commit is contained in:
Stephen Zhou 2026-03-11 18:08:14 +08:00 committed by GitHub
parent 5ff7d2c895
commit 2a3eb87326
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

View File

@ -6,6 +6,20 @@ files=$(git diff --cached --name-only)
api_modified=false api_modified=false
web_modified=false web_modified=false
skip_web_checks=false
git_path() {
git rev-parse --git-path "$1"
}
if [ -f "$(git_path MERGE_HEAD)" ] || \
[ -f "$(git_path CHERRY_PICK_HEAD)" ] || \
[ -f "$(git_path REVERT_HEAD)" ] || \
[ -f "$(git_path SQUASH_MSG)" ] || \
[ -d "$(git_path rebase-merge)" ] || \
[ -d "$(git_path rebase-apply)" ]; then
skip_web_checks=true
fi
for file in $files for file in $files
do do
@ -43,6 +57,11 @@ if $api_modified; then
fi fi
if $web_modified; then if $web_modified; then
if $skip_web_checks; then
echo "Git operation in progress, skipping web checks"
exit 0
fi
echo "Running ESLint on web module" echo "Running ESLint on web module"
if git diff --cached --quiet -- 'web/**/*.ts' 'web/**/*.tsx'; then if git diff --cached --quiet -- 'web/**/*.ts' 'web/**/*.tsx'; then