File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 29
29
uses : tj-actions/changed-files@v45
30
30
with :
31
31
since_last_remote_commit : true
32
- separator : " \n "
32
+ separator : " \\ n"
33
33
files : |
34
34
**/*
35
35
@@ -45,26 +45,31 @@ jobs:
45
45
import json
46
46
import os
47
47
from pathlib import Path
48
+ from typing import Any, Generator
48
49
49
50
50
- def discover() -> list [str]:
51
+ def discover() -> Generator [str, Any, None ]:
51
52
for changed in "${{ steps.changed-files.outputs.all_changed_files }}".split("\n"):
53
+ print(changed)
52
54
path = Path(changed)
53
55
if Path(path.parts[0]).is_dir():
54
56
yield path.parts[0]
55
57
56
58
57
- def jsonify(item_lists: list[str]) -> str:
59
+ def jsonify(item_lists: dict[str, list[str] ]) -> str:
58
60
return json.dumps(item_lists, separators=(",", ":"))
59
61
60
62
61
- def main():
63
+ def main() -> None :
62
64
item_lists = list(set(discover()))
63
65
length = len(item_lists)
64
66
json_modules = jsonify({"service": item_lists})
65
67
66
68
github_output = f"matrix={json_modules}\n"
67
69
70
+ print(github_output)
71
+ print(length)
72
+
68
73
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
69
74
f.write(github_output)
70
75
f.write(f"length={length}\n")
You can’t perform that action at this time.
0 commit comments