From 651d766fcc2f5d1ddeb61366a87c92c862821f15 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 8 Jun 2026 09:32:59 +0800 Subject: [PATCH 1/3] Ignore agent files as changesets ref: https://github.com/changesets/changesets/pull/2066 --- get-changed-packages.ts | 9 +++------ index.ts | 8 ++------ is-changeset.ts | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 is-changeset.ts diff --git a/get-changed-packages.ts b/get-changed-packages.ts index d3c1e81..8950fe3 100644 --- a/get-changed-packages.ts +++ b/get-changed-packages.ts @@ -14,6 +14,8 @@ import jsYaml from "js-yaml"; import micromatch from "micromatch"; import type { ProbotOctokit } from "probot"; +import { isChangeset } from "./is-changeset.ts"; + interface PackageJSON extends ChangesetPackageJSON { workspaces?: ReadonlyArray | { packages: ReadonlyArray }; bolt?: { workspaces: ReadonlyArray }; @@ -118,12 +120,7 @@ export const getChangedPackages = async ({ isPnpm = true; } else if (item.path === ".changeset/pre.json") { preStatePromise = fetchJsonFile(".changeset/pre.json"); - } else if ( - item.path !== ".changeset/README.md" && - item.path.startsWith(".changeset") && - item.path.endsWith(".md") && - changedFiles.includes(item.path) - ) { + } else if (changedFiles.includes(item.path) && isChangeset(item.path)) { const res = /\.changeset\/([^.]+)\.md/.exec(item.path); if (!res) { throw new Error("could not get name from changeset filename"); diff --git a/index.ts b/index.ts index ebb3780..c5eaf63 100644 --- a/index.ts +++ b/index.ts @@ -7,6 +7,7 @@ import markdownTable from "markdown-table"; import type { Probot, Context } from "probot"; import { getChangedPackages } from "./get-changed-packages.ts"; +import { isChangeset } from "./is-changeset.ts"; const getReleasePlanMessage = (releasePlan: ReleasePlan | null) => { if (!releasePlan) return ""; @@ -112,12 +113,7 @@ const hasChangesetBeenAdded = ( changedFilesPromise: ReturnType, ) => changedFilesPromise.then((filesResponse) => - filesResponse.data.some( - (file) => - file.status === "added" && - /^\.changeset\/.+\.md$/.test(file.filename) && - file.filename !== ".changeset/README.md", - ), + filesResponse.data.some((file) => file.status === "added" && isChangeset(file.filename)), ); export default (app: Probot) => { diff --git a/is-changeset.ts b/is-changeset.ts new file mode 100644 index 0000000..fb3fb62 --- /dev/null +++ b/is-changeset.ts @@ -0,0 +1,19 @@ +// Files in `.changeset` that should not be considered as changesets. +// Should match `@changesets/read`. +const ignoredMdFiles = [/^README\.md$/i, "AGENTS.md", "CLAUDE.md", "GEMINI.md"]; + +export function isChangeset(filename: string) { + if (!filename.startsWith(".changeset/")) return false; + + const file = filename.slice(".changeset/".length); + if (file.includes("/")) return false; // Ignore nested files + + // Perform same check as `@changesets/read` + return ( + !file.startsWith(".") && + file.endsWith(".md") && + !ignoredMdFiles.some((pattern) => + typeof pattern === "string" ? pattern === file : pattern.test(file), + ) + ); +} From 290089fb5c901dfd1a74442ea25a4ee23427ef11 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 8 Jun 2026 09:39:03 +0800 Subject: [PATCH 2/3] Fix lint and test --- is-changeset.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/is-changeset.ts b/is-changeset.ts index fb3fb62..b96f7ab 100644 --- a/is-changeset.ts +++ b/is-changeset.ts @@ -6,7 +6,6 @@ export function isChangeset(filename: string) { if (!filename.startsWith(".changeset/")) return false; const file = filename.slice(".changeset/".length); - if (file.includes("/")) return false; // Ignore nested files // Perform same check as `@changesets/read` return ( From f6b369f4d7607b4ee893a290954b13c6ff82ec5c Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 8 Jun 2026 13:46:09 +0800 Subject: [PATCH 3/3] Format --- get-changed-packages.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/get-changed-packages.ts b/get-changed-packages.ts index 2fbc449..dff58c2 100644 --- a/get-changed-packages.ts +++ b/get-changed-packages.ts @@ -12,7 +12,6 @@ import type { Packages, Tool } from "@manypkg/get-packages"; import jsYaml from "js-yaml"; import micromatch from "micromatch"; import type { ProbotOctokit } from "probot"; - import { isChangeset } from "./is-changeset.ts"; interface PackageJSON extends ChangesetPackageJSON {