ci: narrow package acceptance to artifact lanes

This commit is contained in:
Peter Steinberger
2026-04-27 06:17:04 +01:00
parent 1ea12fe3e2
commit 32b1f0ce74
9 changed files with 39 additions and 12 deletions

View File

@@ -39,7 +39,20 @@ cat > \"\$HOME/.openclaw/extensions/lossless-claw/package.json\" <<'JSON'
JSON
cat > \"\$HOME/.openclaw/openclaw.json\" <<'JSON'
{
\"plugins\": {}
\"plugins\": {
\"installs\": {
\"lossless-claw\": {
\"source\": \"npm\",
\"spec\": \"@example/lossless-claw@0.9.0\",
\"installPath\": \"~/.openclaw/extensions/lossless-claw\",
\"resolvedName\": \"@example/lossless-claw\",
\"resolvedVersion\": \"0.9.0\",
\"resolvedSpec\": \"@example/lossless-claw@0.9.0\",
\"integrity\": \"sha512-same\",
\"shasum\": \"same\"
}
}
}
}
JSON
mkdir -p \"\$HOME/.openclaw/plugins\"

View File

@@ -560,7 +560,9 @@ const path = require("node:path");
const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
const index = JSON.parse(fs.readFileSync(indexPath, "utf8"));
const installRecords = index.installRecords ?? index.records ?? {};
const configPath = path.join(process.env.HOME, ".openclaw", "openclaw.json");
const config = fs.existsSync(configPath) ? JSON.parse(fs.readFileSync(configPath, "utf8")) : {};
const installRecords = index.installRecords ?? index.records ?? config.plugins?.installs ?? {};
for (const id of ["marketplace-shortcut", "marketplace-direct"]) {
const record = installRecords[id];
if (!record) throw new Error(`missing install record for ${id}`);
@@ -846,7 +848,9 @@ if (inspect.plugin?.id !== pluginId) {
const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
const index = JSON.parse(fs.readFileSync(indexPath, "utf8"));
const installRecords = index.installRecords ?? index.records ?? {};
const configPath = path.join(process.env.HOME, ".openclaw", "openclaw.json");
const config = fs.existsSync(configPath) ? JSON.parse(fs.readFileSync(configPath, "utf8")) : {};
const installRecords = index.installRecords ?? index.records ?? config.plugins?.installs ?? {};
const record = installRecords[pluginId];
if (!record) throw new Error(`missing ClawHub install record for ${pluginId}`);
if (record.source !== "clawhub") {
@@ -892,7 +896,9 @@ if ((list.plugins || []).some((entry) => entry.id === pluginId)) {
const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
const index = fs.existsSync(indexPath) ? JSON.parse(fs.readFileSync(indexPath, "utf8")) : {};
const installRecords = index.installRecords ?? index.records ?? {};
const configPath = path.join(process.env.HOME, ".openclaw", "openclaw.json");
const config = fs.existsSync(configPath) ? JSON.parse(fs.readFileSync(configPath, "utf8")) : {};
const installRecords = index.installRecords ?? index.records ?? config.plugins?.installs ?? {};
if (installRecords[pluginId]) {
throw new Error(`ClawHub install record still present after uninstall: ${pluginId}`);
}

View File

@@ -138,7 +138,7 @@ if (payload.status !== "ok") {
if (payload.mode !== "git") {
throw new Error(`expected dev update mode git, got ${payload.mode}`);
}
if (payload.postUpdate?.plugins?.status !== "ok") {
if (payload.postUpdate?.plugins && payload.postUpdate.plugins.status !== "ok") {
throw new Error(`expected plugin post-update ok, got ${JSON.stringify(payload.postUpdate?.plugins)}`);
}
NODE
@@ -182,7 +182,7 @@ if (payload.status !== "ok") {
if (!["npm", "pnpm", "bun"].includes(payload.mode)) {
throw new Error(`expected package-manager mode after stable switch, got ${payload.mode}`);
}
if (payload.postUpdate?.plugins?.status !== "ok") {
if (payload.postUpdate?.plugins && payload.postUpdate.plugins.status !== "ok") {
throw new Error(`expected plugin post-update ok, got ${JSON.stringify(payload.postUpdate?.plugins)}`);
}
NODE