From 8644f6d440b41a5f3d77308ec62329cdcf62fea9 Mon Sep 17 00:00:00 2001 From: Vitaliy Stoliarov Date: Sat, 27 Jan 2024 19:17:06 +0200 Subject: [PATCH] Update update-rete-cli.yml --- .github/workflows/update-rete-cli.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update-rete-cli.yml b/.github/workflows/update-rete-cli.yml index b44594a..f2db30f 100644 --- a/.github/workflows/update-rete-cli.yml +++ b/.github/workflows/update-rete-cli.yml @@ -77,16 +77,17 @@ jobs: node-version: 20 - name: Check if Rete CLI is needed to update id: check - run: | - installed=$(npm list rete-cli -p) - - if [[ -z $installed ]]; then - echo "installed=false" >> "$GITHUB_OUTPUT" - else - echo "installed=true" >> "$GITHUB_OUTPUT" - fi + uses: actions/github-script@v7 + with: + script: | + const pkg = require('./package.json') + const deps = [ + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.devDependencies || {}) + ] + return deps.includes('rete-cli') - name: Update Rete CLI - if: steps.check.outputs.installed == 'true' + if: steps.check.outputs.result == 'true' run: | npm i rete-cli@${{ inputs.version }} - name: Create Pull Request