mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Use the changesets bin.js to run version because pnpm has a different strategy for binaries which means the file in .bin isn't a js file
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -68,7 +68,9 @@ import readChangesets from "@changesets/read";
|
|||||||
console.log(
|
console.log(
|
||||||
"No changesets found, attempting to publish any unpublished packages to npm"
|
"No changesets found, attempting to publish any unpublished packages to npm"
|
||||||
);
|
);
|
||||||
let workspaces = await getWorkspaces({ tools: ["yarn", "bolt", "pnpm", "root"] });
|
let workspaces = await getWorkspaces({
|
||||||
|
tools: ["yarn", "bolt", "pnpm", "root"]
|
||||||
|
});
|
||||||
|
|
||||||
if (!workspaces) {
|
if (!workspaces) {
|
||||||
return core.setFailed("Could not find workspaces");
|
return core.setFailed("Could not find workspaces");
|
||||||
@@ -168,10 +170,7 @@ import readChangesets from "@changesets/read";
|
|||||||
let cmd = semver.lt(changesetsCliPkgJson.version, "2.0.0")
|
let cmd = semver.lt(changesetsCliPkgJson.version, "2.0.0")
|
||||||
? "bump"
|
? "bump"
|
||||||
: "version";
|
: "version";
|
||||||
await exec("node", [
|
await exec("node", ["./node_modules/@changesets/cli/bin.js", cmd]);
|
||||||
"./node_modules/.bin/changeset",
|
|
||||||
cmd
|
|
||||||
]);
|
|
||||||
let searchQuery = `repo:${repo}+state:open+head:${versionBranch}+base:${branch}`;
|
let searchQuery = `repo:${repo}+state:open+head:${versionBranch}+base:${branch}`;
|
||||||
let searchResultPromise = octokit.search.issuesAndPullRequests({
|
let searchResultPromise = octokit.search.issuesAndPullRequests({
|
||||||
q: searchQuery
|
q: searchQuery
|
||||||
@@ -198,7 +197,8 @@ ${
|
|||||||
}
|
}
|
||||||
# Releases
|
# Releases
|
||||||
` +
|
` +
|
||||||
(await Promise.all(
|
(
|
||||||
|
await Promise.all(
|
||||||
changedWorkspaces.map(async workspace => {
|
changedWorkspaces.map(async workspace => {
|
||||||
let changelogContents = await fs.readFile(
|
let changelogContents = await fs.readFile(
|
||||||
path.join(workspace.dir, "CHANGELOG.md"),
|
path.join(workspace.dir, "CHANGELOG.md"),
|
||||||
@@ -217,14 +217,17 @@ ${
|
|||||||
entry.content
|
entry.content
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
))
|
)
|
||||||
|
)
|
||||||
.filter(x => x)
|
.filter(x => x)
|
||||||
.sort(sortTheThings)
|
.sort(sortTheThings)
|
||||||
.map(x => x.content)
|
.map(x => x.content)
|
||||||
.join("\n ")
|
.join("\n ")
|
||||||
);
|
);
|
||||||
})();
|
})();
|
||||||
const title = `ci(changeset): generate PR with changelog &${isInPreMode ? ` (${preState.tag})` : ""} version updates`
|
const title = `ci(changeset): generate PR with changelog &${
|
||||||
|
isInPreMode ? ` (${preState.tag})` : ""
|
||||||
|
} version updates`;
|
||||||
await exec("git", ["add", "."]);
|
await exec("git", ["add", "."]);
|
||||||
await exec("git", ["commit", "-m", title]);
|
await exec("git", ["commit", "-m", title]);
|
||||||
await exec("git", ["push", "origin", versionBranch, "--force"]);
|
await exec("git", ["push", "origin", versionBranch, "--force"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user