@clawos-dev/clawd 0.2.746 → 0.2.747
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.cjs +8 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -63196,9 +63196,14 @@ function createGithubApi(args) {
|
|
|
63196
63196
|
}
|
|
63197
63197
|
},
|
|
63198
63198
|
async putSecret(slug, name, value, environment) {
|
|
63199
|
-
if (environment) await must("PUT", `/repos/${slug}/environments/${environment}`, "\u51C6\u5907\u73AF\u5883\u51ED\u636E", {});
|
|
63200
63199
|
const base = secretsPath(slug, environment);
|
|
63201
|
-
|
|
63200
|
+
let first = await request("GET", `${base}/public-key`);
|
|
63201
|
+
if (environment && first.status === 404) {
|
|
63202
|
+
await must("PUT", `/repos/${slug}/environments/${encodeURIComponent(environment)}`, "\u51C6\u5907\u73AF\u5883\u51ED\u636E", {});
|
|
63203
|
+
first = await request("GET", `${base}/public-key`);
|
|
63204
|
+
}
|
|
63205
|
+
if (first.status < 200 || first.status >= 300) throw new GithubApiError(first.status, explain(first.status, "\u53D6\u51ED\u636E\u516C\u94A5", first.json));
|
|
63206
|
+
const pk = first.json;
|
|
63202
63207
|
if (typeof pk?.key !== "string" || typeof pk?.key_id !== "string") throw new GithubApiError(200, "\u4ED3\u5E93\u516C\u94A5\u63A5\u53E3\u56DE\u7684\u5F62\u72B6\u4E0D\u5BF9");
|
|
63203
63208
|
const encrypted_value = await seal(pk.key, value);
|
|
63204
63209
|
await must("PUT", `${base}/${encodeURIComponent(name)}`, `\u5199 ${name}`, { encrypted_value, key_id: pk.key_id });
|
|
@@ -76405,7 +76410,7 @@ function computeMethodAccess(args) {
|
|
|
76405
76410
|
}
|
|
76406
76411
|
|
|
76407
76412
|
// src/version.ts
|
|
76408
|
-
var version = "0.2.
|
|
76413
|
+
var version = "0.2.747".length > 0 ? "0.2.747" : "dev";
|
|
76409
76414
|
|
|
76410
76415
|
// src/cli-probe/probe.ts
|
|
76411
76416
|
var fs87 = __toESM(require("fs"), 1);
|