test: simplify ci changed scope output parsing · openclaw/openclaw@a33d994
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -45,16 +45,15 @@ afterEach(() => {
|
45 | 45 | }); |
46 | 46 | |
47 | 47 | function parseGitHubOutput(output: string): Record<string, string> { |
48 | | -return Object.fromEntries( |
49 | | -output |
50 | | -.trim() |
51 | | -.split("\n") |
52 | | -.filter(Boolean) |
53 | | -.map((line) => { |
54 | | -const separator = line.indexOf("="); |
55 | | -return [line.slice(0, separator), line.slice(separator + 1)]; |
56 | | -}), |
57 | | -); |
| 48 | +const parsed: Record<string, string> = {}; |
| 49 | +for (const line of output.trim().split("\n")) { |
| 50 | +if (!line) { |
| 51 | +continue; |
| 52 | +} |
| 53 | +const separator = line.indexOf("="); |
| 54 | +parsed[line.slice(0, separator)] = line.slice(separator + 1); |
| 55 | +} |
| 56 | +return parsed; |
58 | 57 | } |
59 | 58 | |
60 | 59 | describe("detectChangedScope", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。