mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
ci: enforce changelog attribution policy in pr gates
This commit is contained in:
@@ -155,6 +155,10 @@ if (updated !== original) {
|
||||
EOF_NODE
|
||||
}
|
||||
|
||||
validate_changelog_attribution_policy() {
|
||||
node scripts/check-changelog-attributions.mjs CHANGELOG.md
|
||||
}
|
||||
|
||||
validate_changelog_entry_for_pr() {
|
||||
local pr="$1"
|
||||
local contrib="$2"
|
||||
|
||||
@@ -60,6 +60,7 @@ prepare_gates() {
|
||||
|
||||
if [ "$has_changelog_update" = "true" ]; then
|
||||
normalize_pr_changelog_entries "$pr"
|
||||
validate_changelog_attribution_policy
|
||||
fi
|
||||
|
||||
if [ "$changelog_required" = "true" ]; then
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { findForbiddenChangelogThanks } from "../../scripts/check-changelog-attributions.mjs";
|
||||
|
||||
@@ -25,4 +26,12 @@ describe("check-changelog-attributions", () => {
|
||||
),
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps PR changelog gates on the same attribution policy", () => {
|
||||
const changelogLib = readFileSync("scripts/pr-lib/changelog.sh", "utf8");
|
||||
const gates = readFileSync("scripts/pr-lib/gates.sh", "utf8");
|
||||
|
||||
expect(changelogLib).toContain("node scripts/check-changelog-attributions.mjs CHANGELOG.md");
|
||||
expect(gates).toContain("validate_changelog_attribution_policy");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user