fix(ci): handle empty changed-file lists
Use a Git diff fallback when Woodpecker provides no changed-file list. Co-authored-by: JustMe <mr.toing@outlook.com>
This commit is contained in:
1 parent
dcf096431d
commit
d6b919bc42
1 file changed
+3
-1
+3
-1
@@ -39,7 +39,9 @@ def read_changed_files() -> list[str]:
|
|||||||
try:
|
try:
|
||||||
value = json.loads(raw)
|
value = json.loads(raw)
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
return [str(path).replace("\\", "/") for path in value]
|
changed = [str(path).replace("\\", "/") for path in value]
|
||||||
|
if changed:
|
||||||
|
return changed
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
return [path.strip().replace("\\", "/") for path in raw.split(",") if path.strip()]
|
return [path.strip().replace("\\", "/") for path in raw.split(",") if path.strip()]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user