Skip to content

Commit

Permalink
add version check result output
Browse files Browse the repository at this point in the history
  • Loading branch information
TimurRin committed Jul 28, 2024
1 parent 1bbf3ab commit 621c135
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/actions/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ export async function checkNodejsPackageJsonDependencies(
const fetchedVersions = await fetchNpmPackagesVersion(dependencyKeys);

for (const pkg of dependencyKeys) {
if (fetchedVersions[pkg] !== contents.dependencies[pkg]) {
console.log(
`Updating dep '${pkg}' from ${contents.dependencies[pkg]} to ${fetchedVersions[pkg]}`,
);
}
contents.dependencies[pkg] = fetchedVersions[pkg];
}
} catch (error) {
Expand Down Expand Up @@ -358,6 +363,11 @@ export async function checkNodejsPackageJsonDevDependencies(
const fetchedVersions = await fetchNpmPackagesVersion(devDependencies);

for (const pkg of devDependencies) {
if (fetchedVersions[pkg] !== contents.devDependencies[pkg]) {
console.log(
`Updating dev-dep '${pkg}' from ${contents.devDependencies[pkg]} to ${fetchedVersions[pkg]}`,
);
}
contents.devDependencies[pkg] = fetchedVersions[pkg];
}
} catch (error) {
Expand Down

0 comments on commit 621c135

Please sign in to comment.