优化CI流程 #5

Merged
szhhwh merged 4 commits from dev into main 2025-04-26 21:27:38 +08:00
Showing only changes of commit ff74063961 - Show all commits

View File

@ -21,15 +21,15 @@ jobs:
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)
MD_ONLY=true
IMPORTANT_FILE_CHANGED=false
for file in $CHANGED_FILES; do
if [[ ! $file =~ \.md$ ]]; then
MD_ONLY=false
if [[ $file =~ \.(ts|yaml|json|js)$ ]]; then
IMPORTANT_FILE_CHANGED=true
break
fi
done
if [ "$MD_ONLY" = false ] || [ -z "$CHANGED_FILES" ]; then
if [ "$IMPORTANT_FILE_CHANGED" = true ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT