From 0f996ad4b01f254ada60fafa1724b5e19d7f7088 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 14:33:51 +0100 Subject: [PATCH] ci: enforce changelog attribution policy in pr gates --- scripts/pr-lib/changelog.sh | 4 ++++ scripts/pr-lib/gates.sh | 1 + test/scripts/check-changelog-attributions.test.ts | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/scripts/pr-lib/changelog.sh b/scripts/pr-lib/changelog.sh index 4cdaa99cb60..76e41efc003 100644 --- a/scripts/pr-lib/changelog.sh +++ b/scripts/pr-lib/changelog.sh @@ -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" diff --git a/scripts/pr-lib/gates.sh b/scripts/pr-lib/gates.sh index 5b85ac984dd..492954f9be6 100644 --- a/scripts/pr-lib/gates.sh +++ b/scripts/pr-lib/gates.sh @@ -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 diff --git a/test/scripts/check-changelog-attributions.test.ts b/test/scripts/check-changelog-attributions.test.ts index 6675b8a18b2..0e5a04e764b 100644 --- a/test/scripts/check-changelog-attributions.test.ts +++ b/test/scripts/check-changelog-attributions.test.ts @@ -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"); + }); });