mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
* Switch to Changesets-based release process * Bump version * drop unused variable * Update .github/workflows/version-or-publish.yml Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com> * Push also to a release line branch when releasing * Change node version used in the version-or-publish workflow * Switch to using the local action Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com> * build the action before trying to use it the workflow * Add changeset and actually setup Changesets, lol Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com>
20 lines
570 B
JavaScript
20 lines
570 B
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
const { exec } = require("@actions/exec");
|
|
|
|
process.chdir(path.join(__dirname, ".."));
|
|
|
|
(async () => {
|
|
await exec("changeset", ["version"]);
|
|
|
|
const releaseLine = `v${require("../package.json").version.split(".")[0]}`;
|
|
|
|
const readmePath = path.join(__dirname, "..", "README.md");
|
|
const content = fs.readFileSync(readmePath, "utf8");
|
|
const updatedContent = content.replace(
|
|
/changesets\/action@[^\s]+/g,
|
|
`changesets/action@${releaseLine}`
|
|
);
|
|
fs.writeFileSync(readmePath, updatedContent);
|
|
})();
|