فهرست منبع

Merge pull request #76298 from akien-mga/ci-static-fix-fallback

CI: Fix checks fallback logic when changed files listing is missing
Rémi Verschelde 2 سال پیش
والد
کامیت
8d13620874
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      .github/workflows/static_checks.yml

+ 4 - 4
.github/workflows/static_checks.yml

@@ -47,7 +47,7 @@ jobs:
 
 
       - name: Python style checks via black (black_format.sh)
       - name: Python style checks via black (black_format.sh)
         run: |
         run: |
-          if grep -qE '*\.py|SConstruct|SCsub' changed.txt || [ ! -s changed.txt ]; then
+          if grep -qE '\.py$|SConstruct|SCsub' changed.txt || [ -z "$(cat changed.txt)" ]; then
             bash ./misc/scripts/black_format.sh
             bash ./misc/scripts/black_format.sh
           else
           else
             echo "Skipping Python formatting as no Python files were changed."
             echo "Skipping Python formatting as no Python files were changed."
@@ -55,7 +55,7 @@ jobs:
 
 
       - name: Python scripts static analysis (mypy_check.sh)
       - name: Python scripts static analysis (mypy_check.sh)
         run: |
         run: |
-          if grep -qE '*\.py|SConstruct|SCsub' changed.txt || [ ! -s changed.txt ]; then
+          if grep -qE '\.py$|SConstruct|SCsub' changed.txt || [ -z "$(cat changed.txt)" ]; then
             bash ./misc/scripts/mypy_check.sh
             bash ./misc/scripts/mypy_check.sh
           else
           else
             echo "Skipping Python static analysis as no Python files were changed."
             echo "Skipping Python static analysis as no Python files were changed."
@@ -67,7 +67,7 @@ jobs:
 
 
       - name: JavaScript style and documentation checks via ESLint and JSDoc
       - name: JavaScript style and documentation checks via ESLint and JSDoc
         run: |
         run: |
-          if grep -q "platform/web" changed.txt || [ ! -s changed.txt ]; then
+          if grep -q "platform/web" changed.txt || [ -z "$(cat changed.txt)" ]; then
             cd platform/web
             cd platform/web
             npm ci
             npm ci
             npm run lint
             npm run lint
@@ -91,7 +91,7 @@ jobs:
 
 
       - name: Style checks via dotnet format (dotnet_format.sh)
       - name: Style checks via dotnet format (dotnet_format.sh)
         run: |
         run: |
-          if grep -q "modules/mono" changed.txt || [ ! -s changed.txt ]; then
+          if grep -q "modules/mono" changed.txt || [ -z "$(cat changed.txt)" ]; then
             bash ./misc/scripts/dotnet_format.sh
             bash ./misc/scripts/dotnet_format.sh
           else
           else
             echo "Skipping dotnet format as no C# files were changed."
             echo "Skipping dotnet format as no C# files were changed."