mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:50:43 +00:00
ci: guard changelog bot attributions
This commit is contained in:
@@ -258,6 +258,7 @@ describe("scripts/changed-lanes", () => {
|
||||
});
|
||||
expect(plan.commands.map((command) => command.name)).toEqual([
|
||||
"conflict markers",
|
||||
"changelog attributions",
|
||||
"typecheck core tests",
|
||||
"lint core",
|
||||
"lint scripts",
|
||||
@@ -544,6 +545,7 @@ describe("scripts/changed-lanes", () => {
|
||||
});
|
||||
expect(plan.commands.map((command) => command.args[0])).toEqual([
|
||||
"check:no-conflict-markers",
|
||||
"check:changelog-attributions",
|
||||
"release-metadata:check",
|
||||
"ios:version:check",
|
||||
"config:schema:check",
|
||||
@@ -674,6 +676,7 @@ describe("scripts/changed-lanes", () => {
|
||||
});
|
||||
expect(plan.commands).toEqual([
|
||||
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
|
||||
{ name: "changelog attributions", args: ["check:changelog-attributions"] },
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -684,6 +687,7 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(result.docsOnly).toBe(true);
|
||||
expect(plan.commands).toEqual([
|
||||
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
|
||||
{ name: "changelog attributions", args: ["check:changelog-attributions"] },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
28
test/scripts/check-changelog-attributions.test.ts
Normal file
28
test/scripts/check-changelog-attributions.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { findForbiddenChangelogThanks } from "../../scripts/check-changelog-attributions.mjs";
|
||||
|
||||
describe("check-changelog-attributions", () => {
|
||||
it("flags forbidden bot, org, and maintainer thanks attributions", () => {
|
||||
const content = [
|
||||
"- Internal cleanup. Thanks @codex.",
|
||||
"- Org-owned fix. Thanks @openclaw.",
|
||||
"- Maintainer-owned fix. Thanks @steipete.",
|
||||
"- Mixed credit. Thanks @contributor and @OpenClaw.",
|
||||
].join("\n");
|
||||
|
||||
expect(findForbiddenChangelogThanks(content)).toEqual([
|
||||
{ line: 1, handle: "codex", text: "- Internal cleanup. Thanks @codex." },
|
||||
{ line: 2, handle: "openclaw", text: "- Org-owned fix. Thanks @openclaw." },
|
||||
{ line: 3, handle: "steipete", text: "- Maintainer-owned fix. Thanks @steipete." },
|
||||
{ line: 4, handle: "openclaw", text: "- Mixed credit. Thanks @contributor and @OpenClaw." },
|
||||
]);
|
||||
});
|
||||
|
||||
it("allows external contributor thanks attributions", () => {
|
||||
expect(
|
||||
findForbiddenChangelogThanks(
|
||||
"- User-facing fix. Fixes #123. Thanks @external-contributor and @other-user.",
|
||||
),
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user