Skip to content
Snippets Groups Projects
Unverified Commit f035a205 authored by Diego Sampaio's avatar Diego Sampaio Committed by GitHub
Browse files

Chore: Fix fetching Apps-Engine and MongoDB versions for release notes (#28129)

parent 5bfcab04
No related branches found
No related tags found
No related merge requests found
const { execSync } = require('child_process');
const getMongoVersion = async function({ version, git }) { const getMongoVersion = async function({ version, git }) {
try { try {
const workflows = await git.show([`${ version }:.github/workflows/build_and_test.yml`]); const workflows = await git.show([`${ version }:.github/workflows/ci.yml`]);
const mongoMatch = workflows.match(/mongodb\-version: \[([^\]]+)\]/); const mongoMatch = workflows.match(/compatibleMongoVersions\\": \[([^\]]+)\]/);
if (!mongoMatch) { if (!mongoMatch) {
return []; return [];
} }
...@@ -38,11 +40,14 @@ const getNodeNpmVersions = async function({ version, git, request }) { ...@@ -38,11 +40,14 @@ const getNodeNpmVersions = async function({ version, git, request }) {
const getAppsEngineVersion = async function({ version, git }) { const getAppsEngineVersion = async function({ version, git }) {
try { try {
const packageJson = await git.show([`${ version }:apps/meteor/package-lock.json`]); const result = execSync('yarn why @rocket.chat/apps-engine --json');
const { dependencies } = JSON.parse(packageJson);
const { version: appsEngineVersion } = dependencies['@rocket.chat/apps-engine']; const resultString = result.toString();
return appsEngineVersion; const match = resultString.match(/"@rocket.chat\/meteor@workspace:apps\/meteor".*"@rocket\.chat\/apps\-engine@npm:([^"]+)"/);
if (match) {
return match[1];
}
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment