diff --git a/packages/release-action/src/getMetadata.ts b/packages/release-action/src/getMetadata.ts index 3c677b8e7774..5ca93ed5e8c5 100644 --- a/packages/release-action/src/getMetadata.ts +++ b/packages/release-action/src/getMetadata.ts @@ -1,8 +1,6 @@ import { readFile } from 'fs/promises'; import path from 'path'; -import { getExecOutput } from '@actions/exec'; - import { readPackageJson } from './utils'; export async function getMongoVersion(cwd: string) { @@ -27,14 +25,11 @@ export async function getNodeNpmVersions(cwd: string): Promise<{ node: string; y return packageJson.engines; } -export async function getAppsEngineVersion() { +export async function getAppsEngineVersion(cwd: string) { try { - const result = await getExecOutput('yarn why @rocket.chat/apps-engine --json'); + const result = await readPackageJson(path.join(cwd, 'packages/apps-engine')); - const match = result.stdout.match(/"@rocket\.chat\/meteor@workspace:apps\/meteor".*"@rocket\.chat\/apps\-engine@[^#]+#npm:([^"]+)"/); - if (match) { - return match[1]; - } + return result.version ?? 'Not Available'; } catch (e) { console.error(e); } diff --git a/packages/release-action/src/utils.ts b/packages/release-action/src/utils.ts index 608379fb7c37..ff7dc06318e1 100644 --- a/packages/release-action/src/utils.ts +++ b/packages/release-action/src/utils.ts @@ -109,7 +109,7 @@ Bump ${pkgName} version. export async function getEngineVersionsMd(cwd: string) { const { node } = await getNodeNpmVersions(cwd); - const appsEngine = await getAppsEngineVersion(); + const appsEngine = await getAppsEngineVersion(cwd); const mongo = await getMongoVersion(cwd); return `### Engine versions