summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2023-04-20 18:16:38 +0200
committerYuri Sizov <yuris@humnom.net>2023-04-26 14:18:39 +0200
commitc893968b33cddd3762cd94647753a28031a40c2a (patch)
tree278f24d3dbbc112f10938037c1d171701c4097c8
parent82a17d028dd9981199c537110b0eb4d3fd7e0558 (diff)
CI: Fix checks fallback logic when changed files listing is missing
The file would be one byte (newline) so the check with '-s' failed. (cherry picked from commit 39d24ee80bf53a742cc37ec9b8ffce7570cfdbfe)
-rw-r--r--.github/workflows/static_checks.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml
index 635c2514fa..8dc5e0fbff 100644
--- a/.github/workflows/static_checks.yml
+++ b/.github/workflows/static_checks.yml
@@ -47,7 +47,7 @@ jobs:
- name: Python style checks via black (black_format.sh)
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
else
echo "Skipping Python formatting as no Python files were changed."
@@ -55,7 +55,7 @@ jobs:
- name: Python scripts static analysis (mypy_check.sh)
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
else
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
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
npm ci
npm run lint
@@ -91,7 +91,7 @@ jobs:
- name: Style checks via dotnet format (dotnet_format.sh)
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
else
echo "Skipping dotnet format as no C# files were changed."