diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index bea3c0502..6f7db5752 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -44,11 +44,15 @@ jobs: id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT shell: bash + - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version: "${{ steps.lockversion.outputs.version }}" cache: 'npm' cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' @@ -81,11 +85,17 @@ jobs: - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version: "${{ steps.lockversion.outputs.version }}" + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies run: npm install diff --git a/.github/workflows/if-nodejs-version-bump.yml b/.github/workflows/if-nodejs-version-bump.yml index 3071eb1c9..7e27f90bb 100644 --- a/.github/workflows/if-nodejs-version-bump.yml +++ b/.github/workflows/if-nodejs-version-bump.yml @@ -24,11 +24,15 @@ jobs: - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version: "${{ steps.lockversion.outputs.version }}" cache: 'npm' cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true'