From f31830f05874bec584cf2c866a77c4a0d8fb8cbf Mon Sep 17 00:00:00 2001 From: jackwener Date: Wed, 11 Mar 2026 01:11:54 +0800 Subject: [PATCH] fix: fix ClawHub publish workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add export VERSION (NODE_ENV was not getting version) - Fix API endpoint: api.clawhub.io → clawhub.ai - Add NODE_TLS_REJECT_UNAUTHORIZED=0 for SSL cert issue --- .github/workflows/publish-clawhub.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-clawhub.yml b/.github/workflows/publish-clawhub.yml index bd5234f..bcdf5f7 100644 --- a/.github/workflows/publish-clawhub.yml +++ b/.github/workflows/publish-clawhub.yml @@ -51,11 +51,14 @@ jobs: fi clawhub --no-input login --token "${CLAWHUB_TOKEN}" --no-browser + export VERSION # Workaround: clawhub@0.7.0 publish doesn't send acceptLicenseTerms, # which the server now requires. Use a Node.js script to publish with # the corrected payload. - node - <<'PUBLISH_SCRIPT' + # Note: NODE_TLS_REJECT_UNAUTHORIZED=0 is needed because api.clawhub.io + # has an expired SSL certificate. Remove once ClawHub renews their cert. + NODE_TLS_REJECT_UNAUTHORIZED=0 node - <<'PUBLISH_SCRIPT' const { resolve } = require("path"); const { readFileSync, statSync, readdirSync } = require("fs"); const folder = resolve("."); @@ -105,15 +108,20 @@ jobs: } catch {} if (!token) { console.error("No token found"); process.exit(1); } - const registry = "https://api.clawhub.io"; + const registry = "https://clawhub.ai"; fetch(registry + "/api/v1/skills", { method: "POST", headers: { Authorization: "Bearer " + token }, body: form, - }).then(async r => { + }).then(async (r) => { const text = await r.text(); - if (!r.ok) { console.error("Publish failed:", r.status, text); process.exit(1); } + if (!r.ok) { + console.error("Publish failed:", r.status, text); + process.exit(1); + } console.log("✔ Published", slug + "@" + version); - }).catch(e => { console.error(e); process.exit(1); }); + }).catch((e) => { + console.error(e); + process.exit(1); + }); PUBLISH_SCRIPT -