From 629f80fa136be8f795096b4647cde1ae7a7ca81d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 May 2026 08:33:45 +0100 Subject: [PATCH] Make sonarcloud happier (#33466) * Remove manual npm update in workflow It is no longer necessary * Use already installed deps over npx * Make pnpm work under sudo in workflow * Make pnpm work under sudo in workflow v2 --- .github/workflows/build_desktop_prepare.yaml | 2 +- .github/workflows/build_desktop_test.yaml | 4 +++- .github/workflows/npm-publish.yaml | 4 ---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_desktop_prepare.yaml b/.github/workflows/build_desktop_prepare.yaml index 2420e907cc..1d46a9c3c4 100644 --- a/.github/workflows/build_desktop_prepare.yaml +++ b/.github/workflows/build_desktop_prepare.yaml @@ -170,7 +170,7 @@ jobs: run: | set -e - BUNDLE_HASH=$(npx asar l webapp.asar | grep /bundles/ | head -n 1 | sed 's|.*/||') + BUNDLE_HASH=$(pnpm exec asar l webapp.asar | grep /bundles/ | head -n 1 | sed 's|.*/||') WEBAPP_VERSION=$(./scripts/get-version.ts) WEB_VERSION=${WEBAPP_VERSION:0:12} JS_VERSION=${WEBAPP_VERSION:16:12} diff --git a/.github/workflows/build_desktop_test.yaml b/.github/workflows/build_desktop_test.yaml index 1ec6d7bf73..51bb356213 100644 --- a/.github/workflows/build_desktop_test.yaml +++ b/.github/workflows/build_desktop_test.yaml @@ -42,6 +42,7 @@ jobs: persist-credentials: false - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 + id: pnpm - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: apps/desktop/.node-version @@ -75,12 +76,13 @@ jobs: # We previously disabled the `EnableNodeCliInspectArguments` fuse, but Playwright requires # it to be enabled to test Electron apps, so turn it back on. - name: Set EnableNodeCliInspectArguments fuse enabled - run: $RUN_AS npx @electron/fuses write --app "$EXECUTABLE" EnableNodeCliInspectArguments=on + run: $RUN_AS $PNPM_PATH/pnpm exec electron-fuses write --app "$EXECUTABLE" EnableNodeCliInspectArguments=on working-directory: apps/desktop shell: bash env: # We need sudo on Linux as it is installed in /opt/ RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }} + PNPM_PATH: ${{ steps.pnpm.outputs.bin_dest }} EXECUTABLE: ${{ steps.executable.outputs.path }} - name: Run tests diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index 55a1f37ed7..4e70cc428f 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -35,10 +35,6 @@ jobs: node-version-file: ".node-version" registry-url: "https://registry.npmjs.org" - # Ensure npm 11.5.1 or later is installed - - name: Update npm - run: npm install -g npm@latest - - name: 🛠️ Install dependencies run: pnpm install --frozen-lockfile