Skip to content

Commit

Permalink
chore: bump version in package.json
Browse files Browse the repository at this point in the history
Signed-off-by: djamailer <djamailer@spotify.com>
  • Loading branch information
djamaile committed Dec 6, 2023
1 parent 7f45207 commit f19b841
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@changesets/action",
"version": "2.1.0",
"version": "2.2.0",
"main": "dist/index.js",
"license": "MIT",
"devDependencies": {
Expand Down
11 changes: 7 additions & 4 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ export async function runVersion({
});
let changedPackages = await getChangedPackages(cwd, versionsByDirectory);

releaseVersion = releaseVersion ? releaseVersion : await fs.readJson(
const { version: versionFromPackageJson } = await fs.readJson(
path.resolve(cwd, "package.json")
);
const toUseReleaseVersion = releaseVersion || versionFromPackageJson;

const changelogEntries = await Promise.all(
changedPackages.map(async (pkg) => {
Expand All @@ -245,9 +246,9 @@ export async function runVersion({
})
);
let changelogBody = `
# Release v${releaseVersion}
# Release v${toUseReleaseVersion}
Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=${releaseVersion}](https://backstage.github.io/upgrade-helper/?to=${releaseVersion})
Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=${toUseReleaseVersion}](https://backstage.github.io/upgrade-helper/?to=${toUseReleaseVersion})
${changelogEntries
.filter((x) => x)
Expand All @@ -268,6 +269,8 @@ ${changelogEntries
});
} catch {}

console.log('fullChangelogPath', fullChangelogPath);

await fs.writeFile(fullChangelogPath, changelogBody);

const prBody = `See [${fullChangelogPath}](https://github.com/backstage/backstage/blob/master/${fullChangelogPath}) for more information.`;
Expand Down Expand Up @@ -314,4 +317,4 @@ ${changelogEntries
pullRequestNumber: searchResult.data.items[0].number,
};
}
}
}

0 comments on commit f19b841

Please sign in to comment.