Commit 1746289
authored
fix: address three unresolved review comments in InitStep
- Use `with os.scandir(...)` context manager so the iterator is always
closed even when `any()` short-circuits, preventing file-descriptor
leaks in long-running workflow runs.
- Guard `os.chdir(prev_cwd)` in the `finally` block with a try/except
so an `OSError` (e.g. directory deleted) doesn't bypass returning
the captured `StepResult`.
- Reject non-string `script` values in `validate()` with a clear error
message, rather than silently passing them through to become
`--script True` at runtime.1 parent 86333ab commit 1746289
1 file changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
206 | 210 | | |
207 | 211 | | |
208 | 212 | | |
| |||
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
224 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
225 | 234 | | |
226 | 235 | | |
227 | 236 | | |
| |||
0 commit comments