fix(workflow): require confirmation and honor dry-run for node grants

This commit is contained in:
gitea committed 2026-10-20 17:50:45 +08:00
1 parent fac81b08e8
commit 0e6090a92c
5 files changed
+242 -214

No files matched your search

+8
View File
@@ -587,6 +587,14 @@ async function handleGrantNodes(
};
}
requireMutationConfirmation(parsed, runtime, "开通企业工作流灰度节点", "hose-use workflow nodes grant <type...> --yes");
if (isDryRun(parsed, runtime)) {
return mutationPreview(parsed, runtime, "开通企业工作流灰度节点", corp.corpId || corp.credentials.corpId || corp.id, {
nodes: targetNodes.map(node => findGrayNode(node)?.type || node.trim()),
adminPasswordRequired: Boolean(process.env.HOSE_ADMIN_PASSWORD),
});
}
const password = stringOption(parsed.options, ["password", "pwd", "admin-key"]);
const result = await grantWorkflowNodes(corp, {