更新文件变更检查逻辑
All checks were successful
Checking-doc / check-file-changes (pull_request) Successful in 10s
Checking-doc / build-and-deploy (pull_request) Successful in 2m2s
deploying-doc / build-and-deploy (pull_request) Successful in 2m2s

This commit is contained in:
狮子耗耗 2025-04-26 21:25:10 +08:00
parent 670e061545
commit ff74063961

View File

@ -21,15 +21,15 @@ jobs:
run: | run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} || git diff --name-only HEAD~1 HEAD) CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} || git diff --name-only HEAD~1 HEAD)
MD_ONLY=true IMPORTANT_FILE_CHANGED=false
for file in $CHANGED_FILES; do for file in $CHANGED_FILES; do
if [[ ! $file =~ \.md$ ]]; then if [[ $file =~ \.(ts|yaml|json|js)$ ]]; then
MD_ONLY=false IMPORTANT_FILE_CHANGED=true
break break
fi fi
done done
if [ "$MD_ONLY" = false ] || [ -z "$CHANGED_FILES" ]; then if [ "$IMPORTANT_FILE_CHANGED" = true ]; then
echo "should_run=true" >> $GITHUB_OUTPUT echo "should_run=true" >> $GITHUB_OUTPUT
else else
echo "should_run=false" >> $GITHUB_OUTPUT echo "should_run=false" >> $GITHUB_OUTPUT