From 99f3911475dbb5b8d43d314b24c0882997433868 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 23 Jun 2025 21:23:20 +0300 Subject: [PATCH] feat(pr-lint): support npm, yarn and pnpm (#172) * feat(pr-lint): support npm, yarn and pnpm * chore(ci): resolve cr comments * chore(ci): support all pkg manager caches * chore(ci): reword comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pr-lint/action.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pr-lint/action.yml b/pr-lint/action.yml index bb875a9..66f8f56 100644 --- a/pr-lint/action.yml +++ b/pr-lint/action.yml @@ -47,13 +47,21 @@ runs: - name: Setup Node.js and run tests if: steps.detect-node.outputs.found == 'true' uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - cache: 'npm' - name: Install Node.js dependencies if: steps.detect-node.outputs.found == 'true' shell: bash - run: npm ci + run: | + if [ -f pnpm-lock.yaml ]; then + npm install -g pnpm # GitHub Actions runners don’t come with pnpm + pnpm install + elif [ -f yarn.lock ]; then + yarn install + elif [ -f package-lock.json ]; then + npm ci + else + echo "No supported lockfile found, skipping Node.js dependencies installation." + fi # PHP tests if composer.json exists - name: Detect composer.json