Add universal mutation preview mode

This commit is contained in:
gitea committed 2026-09-11 00:45:27 +08:00
1 parent 0b10a70924
commit 138a4a9498
11 files changed
+384 -92

No files matched your search

+13 -6
View File
@@ -152,6 +152,7 @@ export async function handleWebhookCommand(
}
const autoApprovalRate = webhookRateOption(args.options);
const materialPackFilePolicy = materialPackFilePolicyOptions(args.options);
const dryRun = booleanOption(args.options.dryRun) ?? booleanOption(args.options["dry-run"]);
await runTool(
"seal_webhook_add",
client,
@@ -162,7 +163,8 @@ export async function handleWebhookCommand(
outgoingResultWebhook,
autoApprovalRate,
secret: stringOption(args.options.secret),
materialPackFilePolicy
materialPackFilePolicy,
dryRun
},
outputOptions(args.options)
);
@@ -186,6 +188,7 @@ export async function handleWebhookCommand(
stringOption(args.options["outgoing-result-webhook"]);
const autoApprovalRate = webhookRateOption(args.options);
const materialPackFilePolicy = materialPackFilePolicyOptions(args.options);
const dryRun = booleanOption(args.options.dryRun) ?? booleanOption(args.options["dry-run"]);
if (
name === undefined &&
mode === undefined &&
@@ -193,7 +196,8 @@ export async function handleWebhookCommand(
autoApprovalRate === undefined &&
secret === undefined &&
!rotateSecret &&
materialPackFilePolicy === undefined
materialPackFilePolicy === undefined &&
!dryRun
) {
throw new Error("Webhook update requires at least one field option");
}
@@ -209,7 +213,8 @@ export async function handleWebhookCommand(
autoApprovalRate,
secret,
rotateSecret,
materialPackFilePolicy
materialPackFilePolicy,
dryRun
},
outputOptions(args.options)
);
@@ -218,8 +223,9 @@ export async function handleWebhookCommand(
if (action === "delete") {
const selector = maybeName ?? stringOption(args.options.selector) ?? stringOption(args.options.id);
if (!selector) throw new Error("Usage: seal-use webhook delete <idOrName> --yes");
if (booleanOption(args.options.yes) !== true) {
const dryRun = booleanOption(args.options.dryRun) ?? booleanOption(args.options["dry-run"]);
if (!selector) throw new Error("Usage: seal-use webhook delete <idOrName> [--yes|--dry-run]");
if (booleanOption(args.options.yes) !== true && !dryRun) {
throw new Error("Refusing to delete Webhook integration without --yes");
}
await runTool(
@@ -228,7 +234,8 @@ export async function handleWebhookCommand(
corp,
{
selector,
confirm: true
confirm: true,
dryRun
},
outputOptions(args.options)
);