@aspruyt/xfg 3.9.1 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/settings-command.js +3 -2
- package/dist/cli/sync-command.js +5 -1
- package/dist/output/index.d.ts +2 -1
- package/dist/output/index.js +3 -1
- package/dist/output/settings-report.d.ts +2 -0
- package/dist/output/settings-report.js +4 -4
- package/dist/output/sync-report.js +2 -2
- package/dist/output/unified-summary.d.ts +9 -2
- package/dist/output/unified-summary.js +187 -89
- package/package.json +1 -1
|
@@ -9,7 +9,8 @@ import { logger } from "../shared/logger.js";
|
|
|
9
9
|
import { generateWorkspaceName } from "../shared/workspace-utils.js";
|
|
10
10
|
import { buildErrorResult } from "../output/summary-utils.js";
|
|
11
11
|
import { getManagedRulesets } from "../sync/manifest.js";
|
|
12
|
-
import { formatSettingsReportCLI
|
|
12
|
+
import { formatSettingsReportCLI } from "../output/settings-report.js";
|
|
13
|
+
import { writeUnifiedSummary } from "../output/unified-summary.js";
|
|
13
14
|
import { buildSettingsReport, } from "./settings-report-builder.js";
|
|
14
15
|
import { defaultProcessorFactory, defaultRulesetProcessorFactory, defaultRepoSettingsProcessorFactory, } from "./types.js";
|
|
15
16
|
import { RepoLifecycleManager, runLifecycleCheck, } from "../lifecycle/index.js";
|
|
@@ -318,7 +319,7 @@ export async function runSettings(options, processorFactory = defaultRulesetProc
|
|
|
318
319
|
for (const line of lines) {
|
|
319
320
|
console.log(line);
|
|
320
321
|
}
|
|
321
|
-
|
|
322
|
+
writeUnifiedSummary({ settings: report, dryRun: options.dryRun ?? false });
|
|
322
323
|
const hasErrors = report.repos.some((r) => r.error);
|
|
323
324
|
if (hasErrors) {
|
|
324
325
|
process.exit(1);
|
package/dist/cli/sync-command.js
CHANGED
|
@@ -246,7 +246,11 @@ export async function runSync(options, processorFactory = defaultProcessorFactor
|
|
|
246
246
|
console.log(line);
|
|
247
247
|
}
|
|
248
248
|
// Write unified summary to GITHUB_STEP_SUMMARY
|
|
249
|
-
writeUnifiedSummary(
|
|
249
|
+
writeUnifiedSummary({
|
|
250
|
+
lifecycle: lifecycleReport,
|
|
251
|
+
sync: report,
|
|
252
|
+
dryRun: options.dryRun ?? false,
|
|
253
|
+
});
|
|
250
254
|
// Exit with error if any failures
|
|
251
255
|
const hasErrors = reportResults.some((r) => r.error);
|
|
252
256
|
if (hasErrors) {
|
package/dist/output/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { formatSyncReportCLI, formatSyncReportMarkdown, writeSyncReportSummary, type SyncReport, type RepoFileChanges, type FileChange, } from "./sync-report.js";
|
|
2
|
-
export { formatSettingsReportCLI, formatSettingsReportMarkdown, writeSettingsReportSummary, type SettingsReport, type RepoChanges, type RulesetChange, type SettingChange, } from "./settings-report.js";
|
|
2
|
+
export { formatSettingsReportCLI, formatSettingsReportMarkdown, writeSettingsReportSummary, formatValuePlain, formatRulesetConfigPlain, type SettingsReport, type RepoChanges, type RulesetChange, type SettingChange, } from "./settings-report.js";
|
|
3
|
+
export { formatUnifiedSummaryMarkdown, writeUnifiedSummary, type UnifiedSummaryInput, } from "./unified-summary.js";
|
|
3
4
|
export { formatSummary, isGitHubActions, writeSummary, type MergeOutcome, type FileChanges, type RulesetPlanDetail, type RepoSettingsPlanDetail, type RepoResult, type SummaryData, } from "./github-summary.js";
|
|
4
5
|
export { getMergeOutcome, toFileChanges, buildRepoResult, buildErrorResult, } from "./summary-utils.js";
|
package/dist/output/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Sync report (repo-grouped file changes)
|
|
2
2
|
export { formatSyncReportCLI, formatSyncReportMarkdown, writeSyncReportSummary, } from "./sync-report.js";
|
|
3
3
|
// Settings report (repo-grouped settings changes)
|
|
4
|
-
export { formatSettingsReportCLI, formatSettingsReportMarkdown, writeSettingsReportSummary, } from "./settings-report.js";
|
|
4
|
+
export { formatSettingsReportCLI, formatSettingsReportMarkdown, writeSettingsReportSummary, formatValuePlain, formatRulesetConfigPlain, } from "./settings-report.js";
|
|
5
|
+
// Unified summary (lifecycle + sync + settings in one diff block)
|
|
6
|
+
export { formatUnifiedSummaryMarkdown, writeUnifiedSummary, } from "./unified-summary.js";
|
|
5
7
|
// GitHub Actions summary
|
|
6
8
|
export { formatSummary, isGitHubActions, writeSummary, } from "./github-summary.js";
|
|
7
9
|
// Summary utilities
|
|
@@ -33,5 +33,7 @@ export interface RulesetChange {
|
|
|
33
33
|
config?: Ruleset;
|
|
34
34
|
}
|
|
35
35
|
export declare function formatSettingsReportCLI(report: SettingsReport): string[];
|
|
36
|
+
export declare function formatValuePlain(val: unknown): string;
|
|
37
|
+
export declare function formatRulesetConfigPlain(config: Ruleset): string[];
|
|
36
38
|
export declare function formatSettingsReportMarkdown(report: SettingsReport, dryRun: boolean): string;
|
|
37
39
|
export declare function writeSettingsReportSummary(report: SettingsReport, dryRun: boolean): void;
|
|
@@ -153,7 +153,7 @@ export function formatSettingsReportCLI(report) {
|
|
|
153
153
|
// =============================================================================
|
|
154
154
|
// Markdown Formatter
|
|
155
155
|
// =============================================================================
|
|
156
|
-
function formatValuePlain(val) {
|
|
156
|
+
export function formatValuePlain(val) {
|
|
157
157
|
if (val === null)
|
|
158
158
|
return "null";
|
|
159
159
|
if (val === undefined)
|
|
@@ -164,7 +164,7 @@ function formatValuePlain(val) {
|
|
|
164
164
|
return val ? "true" : "false";
|
|
165
165
|
return String(val);
|
|
166
166
|
}
|
|
167
|
-
function formatRulesetConfigPlain(config) {
|
|
167
|
+
export function formatRulesetConfigPlain(config) {
|
|
168
168
|
const lines = [];
|
|
169
169
|
function renderObject(obj, depth) {
|
|
170
170
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -216,8 +216,8 @@ function formatRulesetConfigPlain(config) {
|
|
|
216
216
|
export function formatSettingsReportMarkdown(report, dryRun) {
|
|
217
217
|
const lines = [];
|
|
218
218
|
// Title
|
|
219
|
-
const
|
|
220
|
-
lines.push(
|
|
219
|
+
const title = dryRun ? "## xfg Plan" : "## xfg Apply";
|
|
220
|
+
lines.push(title);
|
|
221
221
|
lines.push("");
|
|
222
222
|
// Dry-run warning
|
|
223
223
|
if (dryRun) {
|
|
@@ -49,8 +49,8 @@ export function formatSyncReportCLI(report) {
|
|
|
49
49
|
export function formatSyncReportMarkdown(report, dryRun) {
|
|
50
50
|
const lines = [];
|
|
51
51
|
// Title
|
|
52
|
-
const
|
|
53
|
-
lines.push(
|
|
52
|
+
const title = dryRun ? "## xfg Plan" : "## xfg Apply";
|
|
53
|
+
lines.push(title);
|
|
54
54
|
lines.push("");
|
|
55
55
|
// Dry-run warning
|
|
56
56
|
if (dryRun) {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { LifecycleReport } from "./lifecycle-report.js";
|
|
2
2
|
import type { SyncReport } from "./sync-report.js";
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
import type { SettingsReport } from "./settings-report.js";
|
|
4
|
+
export interface UnifiedSummaryInput {
|
|
5
|
+
lifecycle?: LifecycleReport;
|
|
6
|
+
sync?: SyncReport;
|
|
7
|
+
settings?: SettingsReport;
|
|
8
|
+
dryRun: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function formatUnifiedSummaryMarkdown(input: UnifiedSummaryInput): string;
|
|
11
|
+
export declare function writeUnifiedSummary(input: UnifiedSummaryInput): void;
|
|
@@ -1,127 +1,225 @@
|
|
|
1
1
|
// src/output/unified-summary.ts
|
|
2
2
|
import { appendFileSync } from "node:fs";
|
|
3
3
|
import { hasLifecycleChanges } from "./lifecycle-report.js";
|
|
4
|
+
import { formatValuePlain, formatRulesetConfigPlain, } from "./settings-report.js";
|
|
4
5
|
// =============================================================================
|
|
5
6
|
// Helpers
|
|
6
7
|
// =============================================================================
|
|
7
|
-
function formatCombinedSummary(
|
|
8
|
+
function formatCombinedSummary(input) {
|
|
8
9
|
const parts = [];
|
|
9
10
|
// Lifecycle totals
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
repoParts
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
if (input.lifecycle) {
|
|
12
|
+
const t = input.lifecycle.totals;
|
|
13
|
+
const repoTotal = t.created + t.forked + t.migrated;
|
|
14
|
+
if (repoTotal > 0) {
|
|
15
|
+
const repoParts = [];
|
|
16
|
+
if (t.created > 0)
|
|
17
|
+
repoParts.push(`${t.created} to create`);
|
|
18
|
+
if (t.forked > 0)
|
|
19
|
+
repoParts.push(`${t.forked} to fork`);
|
|
20
|
+
if (t.migrated > 0)
|
|
21
|
+
repoParts.push(`${t.migrated} to migrate`);
|
|
22
|
+
const repoWord = repoTotal === 1 ? "repo" : "repos";
|
|
23
|
+
parts.push(`${repoTotal} ${repoWord} (${repoParts.join(", ")})`);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
// Sync totals
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
fileParts
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
if (input.sync) {
|
|
28
|
+
const t = input.sync.totals;
|
|
29
|
+
const fileTotal = t.files.create + t.files.update + t.files.delete;
|
|
30
|
+
if (fileTotal > 0) {
|
|
31
|
+
const fileParts = [];
|
|
32
|
+
if (t.files.create > 0)
|
|
33
|
+
fileParts.push(`${t.files.create} to create`);
|
|
34
|
+
if (t.files.update > 0)
|
|
35
|
+
fileParts.push(`${t.files.update} to update`);
|
|
36
|
+
if (t.files.delete > 0)
|
|
37
|
+
fileParts.push(`${t.files.delete} to delete`);
|
|
38
|
+
const fileWord = fileTotal === 1 ? "file" : "files";
|
|
39
|
+
parts.push(`${fileTotal} ${fileWord} (${fileParts.join(", ")})`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Settings totals
|
|
43
|
+
if (input.settings) {
|
|
44
|
+
const t = input.settings.totals;
|
|
45
|
+
const settingsTotal = t.settings.add + t.settings.change;
|
|
46
|
+
if (settingsTotal > 0) {
|
|
47
|
+
const settingWord = settingsTotal === 1 ? "setting" : "settings";
|
|
48
|
+
const actions = [];
|
|
49
|
+
if (t.settings.add > 0)
|
|
50
|
+
actions.push(`${t.settings.add} to add`);
|
|
51
|
+
if (t.settings.change > 0)
|
|
52
|
+
actions.push(`${t.settings.change} to change`);
|
|
53
|
+
parts.push(`${settingsTotal} ${settingWord} (${actions.join(", ")})`);
|
|
54
|
+
}
|
|
55
|
+
const rulesetsTotal = t.rulesets.create + t.rulesets.update + t.rulesets.delete;
|
|
56
|
+
if (rulesetsTotal > 0) {
|
|
57
|
+
const rulesetWord = rulesetsTotal === 1 ? "ruleset" : "rulesets";
|
|
58
|
+
const actions = [];
|
|
59
|
+
if (t.rulesets.create > 0)
|
|
60
|
+
actions.push(`${t.rulesets.create} to create`);
|
|
61
|
+
if (t.rulesets.update > 0)
|
|
62
|
+
actions.push(`${t.rulesets.update} to update`);
|
|
63
|
+
if (t.rulesets.delete > 0)
|
|
64
|
+
actions.push(`${t.rulesets.delete} to delete`);
|
|
65
|
+
parts.push(`${rulesetsTotal} ${rulesetWord} (${actions.join(", ")})`);
|
|
66
|
+
}
|
|
34
67
|
}
|
|
35
68
|
if (parts.length === 0) {
|
|
36
69
|
return "No changes";
|
|
37
70
|
}
|
|
38
71
|
return `Plan: ${parts.join(", ")}`;
|
|
39
72
|
}
|
|
73
|
+
function hasAnyChanges(input) {
|
|
74
|
+
if (input.lifecycle && hasLifecycleChanges(input.lifecycle))
|
|
75
|
+
return true;
|
|
76
|
+
if (input.sync?.repos.some((r) => r.files.length > 0 || r.error))
|
|
77
|
+
return true;
|
|
78
|
+
if (input.settings?.repos.some((r) => r.settings.length > 0 || r.rulesets.length > 0 || r.error))
|
|
79
|
+
return true;
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
// =============================================================================
|
|
83
|
+
// Diff line builders
|
|
84
|
+
// =============================================================================
|
|
85
|
+
function renderLifecycleLines(lcAction, diffLines) {
|
|
86
|
+
if (lcAction.action === "existed")
|
|
87
|
+
return;
|
|
88
|
+
switch (lcAction.action) {
|
|
89
|
+
case "created":
|
|
90
|
+
diffLines.push(`+ CREATE`);
|
|
91
|
+
break;
|
|
92
|
+
case "forked":
|
|
93
|
+
diffLines.push(`+ FORK ${lcAction.upstream ?? "upstream"} -> ${lcAction.repoName}`);
|
|
94
|
+
break;
|
|
95
|
+
case "migrated":
|
|
96
|
+
diffLines.push(`+ MIGRATE ${lcAction.source ?? "source"} -> ${lcAction.repoName}`);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (lcAction.settings) {
|
|
100
|
+
if (lcAction.settings.visibility) {
|
|
101
|
+
diffLines.push(`+ visibility: ${lcAction.settings.visibility}`);
|
|
102
|
+
}
|
|
103
|
+
if (lcAction.settings.description) {
|
|
104
|
+
diffLines.push(`+ description: "${lcAction.settings.description}"`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function renderSyncLines(syncRepo, diffLines) {
|
|
109
|
+
for (const file of syncRepo.files) {
|
|
110
|
+
if (file.action === "create") {
|
|
111
|
+
diffLines.push(`+ ${file.path}`);
|
|
112
|
+
}
|
|
113
|
+
else if (file.action === "update") {
|
|
114
|
+
diffLines.push(`! ${file.path}`);
|
|
115
|
+
}
|
|
116
|
+
else if (file.action === "delete") {
|
|
117
|
+
diffLines.push(`- ${file.path}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (syncRepo.error) {
|
|
121
|
+
diffLines.push(`- Error: ${syncRepo.error}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function renderSettingsLines(settingsRepo, diffLines) {
|
|
125
|
+
for (const setting of settingsRepo.settings) {
|
|
126
|
+
if (setting.oldValue === undefined && setting.newValue === undefined) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (setting.action === "add") {
|
|
130
|
+
diffLines.push(`+ ${setting.name}: ${formatValuePlain(setting.newValue)}`);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
diffLines.push(`! ${setting.name}: ${formatValuePlain(setting.oldValue)} → ${formatValuePlain(setting.newValue)}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (const ruleset of settingsRepo.rulesets) {
|
|
137
|
+
if (ruleset.action === "create") {
|
|
138
|
+
diffLines.push(`+ ruleset "${ruleset.name}"`);
|
|
139
|
+
if (ruleset.config) {
|
|
140
|
+
diffLines.push(...formatRulesetConfigPlain(ruleset.config));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else if (ruleset.action === "update") {
|
|
144
|
+
diffLines.push(`! ruleset "${ruleset.name}"`);
|
|
145
|
+
if (ruleset.propertyDiffs && ruleset.propertyDiffs.length > 0) {
|
|
146
|
+
for (const diff of ruleset.propertyDiffs) {
|
|
147
|
+
const path = diff.path.join(".");
|
|
148
|
+
if (diff.action === "add") {
|
|
149
|
+
diffLines.push(`+ ${path}: ${formatValuePlain(diff.newValue)}`);
|
|
150
|
+
}
|
|
151
|
+
else if (diff.action === "change") {
|
|
152
|
+
diffLines.push(`! ${path}: ${formatValuePlain(diff.oldValue)} → ${formatValuePlain(diff.newValue)}`);
|
|
153
|
+
}
|
|
154
|
+
else if (diff.action === "remove") {
|
|
155
|
+
diffLines.push(`- ${path}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else if (ruleset.action === "delete") {
|
|
161
|
+
diffLines.push(`- ruleset "${ruleset.name}"`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (settingsRepo.error) {
|
|
165
|
+
diffLines.push(`- Error: ${settingsRepo.error}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
40
168
|
// =============================================================================
|
|
41
169
|
// Markdown Formatter
|
|
42
170
|
// =============================================================================
|
|
43
|
-
export function formatUnifiedSummaryMarkdown(
|
|
44
|
-
|
|
45
|
-
const hasSync = sync.repos.some((r) => r.files.length > 0 || r.error);
|
|
46
|
-
if (!hasLifecycle && !hasSync) {
|
|
171
|
+
export function formatUnifiedSummaryMarkdown(input) {
|
|
172
|
+
if (!hasAnyChanges(input)) {
|
|
47
173
|
return "";
|
|
48
174
|
}
|
|
49
175
|
const lines = [];
|
|
50
|
-
// Title
|
|
51
|
-
const
|
|
52
|
-
lines.push(
|
|
176
|
+
// Title: "xfg Plan" for dry-run, "xfg Apply" otherwise
|
|
177
|
+
const title = input.dryRun ? "## xfg Plan" : "## xfg Apply";
|
|
178
|
+
lines.push(title);
|
|
53
179
|
lines.push("");
|
|
54
180
|
// Dry-run warning
|
|
55
|
-
if (dryRun) {
|
|
181
|
+
if (input.dryRun) {
|
|
56
182
|
lines.push("> [!WARNING]");
|
|
57
183
|
lines.push("> This was a dry run — no changes were applied");
|
|
58
184
|
lines.push("");
|
|
59
185
|
}
|
|
60
|
-
// Build lookup maps
|
|
61
|
-
const lifecycleByRepo = new Map(lifecycle
|
|
62
|
-
const syncByRepo = new Map(sync
|
|
63
|
-
|
|
186
|
+
// Build lookup maps
|
|
187
|
+
const lifecycleByRepo = new Map((input.lifecycle?.actions ?? []).map((a) => [a.repoName, a]));
|
|
188
|
+
const syncByRepo = new Map((input.sync?.repos ?? []).map((r) => [r.repoName, r]));
|
|
189
|
+
const settingsByRepo = new Map((input.settings?.repos ?? []).map((r) => [r.repoName, r]));
|
|
190
|
+
// Collect all repo names in order
|
|
64
191
|
const allRepos = [];
|
|
65
|
-
|
|
66
|
-
if (!allRepos.includes(
|
|
67
|
-
allRepos.push(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
192
|
+
const addRepo = (name) => {
|
|
193
|
+
if (!allRepos.includes(name))
|
|
194
|
+
allRepos.push(name);
|
|
195
|
+
};
|
|
196
|
+
for (const a of input.lifecycle?.actions ?? [])
|
|
197
|
+
addRepo(a.repoName);
|
|
198
|
+
for (const r of input.sync?.repos ?? [])
|
|
199
|
+
addRepo(r.repoName);
|
|
200
|
+
for (const r of input.settings?.repos ?? [])
|
|
201
|
+
addRepo(r.repoName);
|
|
75
202
|
// Diff block
|
|
76
203
|
const diffLines = [];
|
|
77
204
|
for (const repoName of allRepos) {
|
|
78
205
|
const lcAction = lifecycleByRepo.get(repoName);
|
|
79
206
|
const syncRepo = syncByRepo.get(repoName);
|
|
207
|
+
const settingsRepo = settingsByRepo.get(repoName);
|
|
80
208
|
const hasLcChange = lcAction && lcAction.action !== "existed";
|
|
81
209
|
const hasSyncChanges = syncRepo && (syncRepo.files.length > 0 || syncRepo.error);
|
|
82
|
-
|
|
210
|
+
const hasSettingsChanges = settingsRepo &&
|
|
211
|
+
(settingsRepo.settings.length > 0 ||
|
|
212
|
+
settingsRepo.rulesets.length > 0 ||
|
|
213
|
+
settingsRepo.error);
|
|
214
|
+
if (!hasLcChange && !hasSyncChanges && !hasSettingsChanges)
|
|
83
215
|
continue;
|
|
84
|
-
// Repo header
|
|
85
216
|
diffLines.push(`@@ ${repoName} @@`);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
case "forked":
|
|
93
|
-
diffLines.push(`+ FORK ${lcAction.upstream ?? "upstream"} -> ${repoName}`);
|
|
94
|
-
break;
|
|
95
|
-
case "migrated":
|
|
96
|
-
diffLines.push(`+ MIGRATE ${lcAction.source ?? "source"} -> ${repoName}`);
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (lcAction.settings) {
|
|
100
|
-
if (lcAction.settings.visibility) {
|
|
101
|
-
diffLines.push(`+ visibility: ${lcAction.settings.visibility}`);
|
|
102
|
-
}
|
|
103
|
-
if (lcAction.settings.description) {
|
|
104
|
-
diffLines.push(`+ description: "${lcAction.settings.description}"`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// File changes
|
|
109
|
-
if (syncRepo) {
|
|
110
|
-
for (const file of syncRepo.files) {
|
|
111
|
-
if (file.action === "create") {
|
|
112
|
-
diffLines.push(`+ ${file.path}`);
|
|
113
|
-
}
|
|
114
|
-
else if (file.action === "update") {
|
|
115
|
-
diffLines.push(`! ${file.path}`);
|
|
116
|
-
}
|
|
117
|
-
else if (file.action === "delete") {
|
|
118
|
-
diffLines.push(`- ${file.path}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (syncRepo.error) {
|
|
122
|
-
diffLines.push(`- Error: ${syncRepo.error}`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
217
|
+
if (lcAction)
|
|
218
|
+
renderLifecycleLines(lcAction, diffLines);
|
|
219
|
+
if (syncRepo)
|
|
220
|
+
renderSyncLines(syncRepo, diffLines);
|
|
221
|
+
if (settingsRepo)
|
|
222
|
+
renderSettingsLines(settingsRepo, diffLines);
|
|
125
223
|
}
|
|
126
224
|
if (diffLines.length > 0) {
|
|
127
225
|
lines.push("```diff");
|
|
@@ -130,17 +228,17 @@ export function formatUnifiedSummaryMarkdown(lifecycle, sync, dryRun) {
|
|
|
130
228
|
lines.push("");
|
|
131
229
|
}
|
|
132
230
|
// Combined summary
|
|
133
|
-
lines.push(`**${formatCombinedSummary(
|
|
231
|
+
lines.push(`**${formatCombinedSummary(input)}**`);
|
|
134
232
|
return lines.join("\n");
|
|
135
233
|
}
|
|
136
234
|
// =============================================================================
|
|
137
235
|
// File Writer
|
|
138
236
|
// =============================================================================
|
|
139
|
-
export function writeUnifiedSummary(
|
|
237
|
+
export function writeUnifiedSummary(input) {
|
|
140
238
|
const summaryPath = process.env.GITHUB_STEP_SUMMARY;
|
|
141
239
|
if (!summaryPath)
|
|
142
240
|
return;
|
|
143
|
-
const markdown = formatUnifiedSummaryMarkdown(
|
|
241
|
+
const markdown = formatUnifiedSummaryMarkdown(input);
|
|
144
242
|
if (!markdown)
|
|
145
243
|
return;
|
|
146
244
|
appendFileSync(summaryPath, "\n" + markdown + "\n");
|
package/package.json
CHANGED