From 0c54efe8c6d6827deaa8edfc8fb65a7a8563eb78 Mon Sep 17 00:00:00 2001 From: Jan Kubica Date: Fri, 24 Jul 2026 15:20:06 +0200 Subject: [PATCH] fix: trigger publishing only for version releases --- .github/workflows/publish.yml | 6 ++++-- scripts/bun-lock-workspace-versions.test.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d9e51d3..d073733 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,8 +4,10 @@ on: push: branches: [main] paths: - - packages/typescript-config/package.json - - packages/oxlint-config/package.json + # Changesets owns these files, so ordinary manifest maintenance cannot + # accidentally start a release transaction. + - packages/typescript-config/CHANGELOG.md + - packages/oxlint-config/CHANGELOG.md workflow_dispatch: inputs: publish_to_npm: diff --git a/scripts/bun-lock-workspace-versions.test.ts b/scripts/bun-lock-workspace-versions.test.ts index f685a2f..061d9c3 100644 --- a/scripts/bun-lock-workspace-versions.test.ts +++ b/scripts/bun-lock-workspace-versions.test.ts @@ -68,4 +68,19 @@ describe("bun.lock workspace self-version synchronization", () => { expect(command).toContain("check-lockfile-workspace-versions.ts --write"); expect(command).toEndWith("bun install --frozen-lockfile"); }); + + test("automatic publishing only uses Changesets release signals", async () => { + const publishWorkflow = await Bun.file( + new URL("../.github/workflows/publish.yml", import.meta.url), + ).text(); + const pushTrigger = publishWorkflow.slice( + 0, + publishWorkflow.indexOf(" workflow_dispatch:"), + ); + + for (const packageName of ["typescript-config", "oxlint-config"]) { + expect(pushTrigger).toContain(`packages/${packageName}/CHANGELOG.md`); + expect(pushTrigger).not.toContain(`packages/${packageName}/package.json`); + } + }); });