Skip to content

Commit

Permalink
chore: fix version check script
Browse files Browse the repository at this point in the history
  • Loading branch information
juditgreskovits committed Nov 18, 2024
1 parent 443197a commit 42cfaf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ci/version-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const { version: mainVersion } = require(`${process.cwd()}/package.json`);

console.log(`Current version ${version}`);

type VersionData = { name: string };

const validateVersion = async () => {
if (version !== mainVersion) {
return Promise.reject(`Please ensure top level version and package version are the same`);
Expand All @@ -13,9 +15,8 @@ const validateVersion = async () => {
if (response.status >= 400) {
return Promise.reject(`Invalid response for tag request ${response.status}`);
}
const data = await response.json();
const releases = data.map(({ name }: { name: string }) => name);
console.log('Existing releases', releases);
const data = (await response.json()) as VersionData[];
const releases = (data as []).map(({ name }: { name: string }) => name);
if (!releases.length || releases.includes(version)) {
return Promise.reject(
`Version ${version} has already been released, please update nx-playwright version`,
Expand Down
2 changes: 1 addition & 1 deletion packages/nx-playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mands/nx-playwright",
"version": "0.6.3",
"version": "0.7.0",
"license": "MIT",
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down

0 comments on commit 42cfaf0

Please sign in to comment.