From f10dc81fecffdb6ff53d177f04b495b5aea95382 Mon Sep 17 00:00:00 2001 From: Serhii Marchenko Date: Mon, 11 Dec 2023 13:52:15 +0200 Subject: [PATCH] upd script --- .github/workflows/update_dependencies.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_dependencies.yaml b/.github/workflows/update_dependencies.yaml index c126a49e8..1f8571488 100644 --- a/.github/workflows/update_dependencies.yaml +++ b/.github/workflows/update_dependencies.yaml @@ -114,9 +114,12 @@ jobs: latestVersion=$versionValue fi + # Get the current version from package.json + local currentVersion=$(jq -r ".dependencies.\"$packageName\"" package.json) + # Update the package.json file only if the version has changed - if [[ "$(jq -r ".dependencies.\"$packageName\"" package.json)" != "$latestVersion" ]]; then - echo "Update $packageName from $(jq -r ".dependencies.\"$packageName\"" package.json) to version $latestVersion" + if [[ "$currentVersion" != "$latestVersion" ]]; then + echo "Update $packageName from $currentVersion to version $latestVersion" yarn add $packageName@$latestVersion --silent echo "COMMIT_REQUIRED=true" >> $GITHUB_ENV else