fix(ci): make npm bootstrap retries idempotent

This commit is contained in:
Peter Steinberger
2026-07-17 06:54:26 +01:00
parent f4f5150557
commit d8dd59bf8f
2 changed files with 65 additions and 2 deletions

View File

@@ -329,8 +329,19 @@ describe("plugin npm extended-stable workflow", () => {
});
expect(publish.env?.NODE_AUTH_TOKEN).toBeUndefined();
expect(publish.env?.NPM_TOKEN).toBeUndefined();
const bootstrapCheck = step(
parsed.jobs?.publish_plugins_npm,
"Check bootstrap npm package version",
);
expect(bootstrapCheck.if).toContain("npm-token-bootstrap");
expect(bootstrapCheck.run).toContain("fetchNpmRegistryPackumentWithRetry");
expect(bootstrapCheck.run).toContain("publishedDist.integrity !== expectedIntegrity");
expect(bootstrapCheck.run).toContain("already_published=true");
const bootstrap = step(parsed.jobs?.publish_plugins_npm, "Publish approved bootstrap tarball");
expect(bootstrap.if).toContain("npm-token-bootstrap");
expect(bootstrap.if).toContain(
"steps.bootstrap_npm_package_version.outputs.already_published != 'true'",
);
expect(bootstrap.env?.NPM_TOKEN).toBe("${{ secrets.NPM_TOKEN }}");
expect(bootstrap.env?.PACKAGE_NAME).toContain("publication_evidence.outputs.package_name");
expect(bootstrap.run).not.toContain("@openclaw/meta-provider");