mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
double negative var
This commit is contained in:
+6
-4
@@ -37,8 +37,8 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
|
|||||||
|
|
||||||
let publishScript = core.getInput("publish");
|
let publishScript = core.getInput("publish");
|
||||||
let hasChangesets = changesets.length !== 0;
|
let hasChangesets = changesets.length !== 0;
|
||||||
const hasNonEmptyChangesets = changesets.some(
|
const isAllChangesetsEmpty = changesets.every(
|
||||||
(changeset) => changeset.releases.length > 0
|
(changeset) => changeset.releases.length === 0
|
||||||
);
|
);
|
||||||
let hasPublishScript = !!publishScript;
|
let hasPublishScript = !!publishScript;
|
||||||
|
|
||||||
@@ -48,7 +48,9 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
|
|||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case !hasChangesets && !hasPublishScript:
|
case !hasChangesets && !hasPublishScript:
|
||||||
core.info("No changesets present or were removed by merging release PR. Not publishing because no publish script found.");
|
core.info(
|
||||||
|
"No changesets present or were removed by merging release PR. Not publishing because no publish script found."
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
case !hasChangesets && hasPublishScript: {
|
case !hasChangesets && hasPublishScript: {
|
||||||
core.info(
|
core.info(
|
||||||
@@ -99,7 +101,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case hasChangesets && !hasNonEmptyChangesets:
|
case hasChangesets && isAllChangesetsEmpty:
|
||||||
core.info("All changesets are empty; not creating PR");
|
core.info("All changesets are empty; not creating PR");
|
||||||
return;
|
return;
|
||||||
case hasChangesets:
|
case hasChangesets:
|
||||||
|
|||||||
Reference in New Issue
Block a user