ci: enforce changelog attribution policy in pr gates

This commit is contained in:
Peter Steinberger
2026-04-27 14:33:51 +01:00
parent ad0f600450
commit 0f996ad4b0
3 changed files with 14 additions and 0 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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");
});
});