mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
* fix release line timing * Use split publishing workflow * remove release check, handle through publish plan * remove unused script * remove unused publish plan output * fmt * update a thing * fmt * simplify * update pre * update changesets cli
21 lines
666 B
TypeScript
21 lines
666 B
TypeScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { exec } from "@actions/exec";
|
|
|
|
process.chdir(path.join(import.meta.dirname, ".."));
|
|
|
|
await exec("changeset", ["version"]);
|
|
|
|
// read after versioning to get the new version
|
|
const pkgJson = (await import("../package.json", { with: { type: "json" } }))
|
|
.default;
|
|
const releaseLine = `v${pkgJson.version.split(".")[0]}`;
|
|
|
|
const readmePath = path.join(import.meta.dirname, "..", "README.md");
|
|
const content = fs.readFileSync(readmePath, "utf8");
|
|
const updatedContent = content.replace(
|
|
/changesets\/action@[^\s]+/g,
|
|
`changesets/action@${releaseLine}`,
|
|
);
|
|
fs.writeFileSync(readmePath, updatedContent);
|