Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/three-needles-protect.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
"@changesets/action": patch
---

Skip creating a PR when all existing changesets are empty.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,6 +37,9 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;

let publishScript = core.getInput("publish");
let hasChangesets = changesets.length !== 0;
const hasNonEmptyChangesets = changesets.some(
(changeset) => changeset.releases.length > 0
);
let hasPublishScript = !!publishScript;

core.setOutput("published", "false");
Expand DownExpand Up@@ -96,6 +99,9 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
}
return;
}
case hasChangesets && !hasNonEmptyChangesets:
console.log("All changesets are empty; not creating PR");
return;
case hasChangesets:
const { pullRequestNumber } = await runVersion({
script: getOptionalInput("version"),
Expand Down