Upstream made more future-proof (#4083)

* Add some logs to verfiy

* Verify equals solution

* Test for of solution

* Code cleanup
This commit is contained in:
MichalKinas 2024-09-03 06:51:27 +02:00 committed by GitHub
parent f1ea9048b4
commit 830887528b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,8 +24,16 @@ module.exports = async ({ exec, github, dependencyName, tag }) => {
}
};
await exec.exec(`npm dist-tag ls @alfresco/${dependencyName}`, [], options);
let matchedPkgVersion = '';
const tagsType = packageDistTag.split('\n');
const matchedPkgVersion = tagsType.find((tagType) => tagType.includes(tag))?.split(':')[1].trim();
for (const tagType of tagsType) {
const tagSplit = tagType.split(':');
if (tagSplit[0].trim() === tag) {
matchedPkgVersion = tagSplit[1].trim();
break;
}
}
const latestPkgToUpdate = availablePackages.find((package) => package.name === matchedPkgVersion);
if (localVersion === latestPkgToUpdate?.name) {