更新文件变更检查逻辑
This commit is contained in:
parent
670e061545
commit
ff74063961
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user