From 1b6d7240a85bc397e71ccba8c617036e3362ae21 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 20 Nov 2025 15:09:58 +0200 Subject: [PATCH] refactor: migrate Node.js linters from common-cache to actions/cache Replace common-cache wrapper with native actions/cache@v4.3.0 in all Node.js linting actions. Changes: - biome-lint: Use actions/cache with direct hashFiles() - eslint-lint: Use actions/cache with direct hashFiles() - prettier-lint: Use actions/cache with direct hashFiles() - pr-lint: Use actions/cache with direct hashFiles() All actions now use: - Native GitHub Actions cache functionality - Multi-lock-file support (npm, yarn, pnpm, bun) - Two-level restore-keys for graceful fallback - OS-aware cache keys with runner.os Benefits: - No wrapper overhead - Native hashFiles() instead of manual SHA256 - Consistent caching pattern across all Node.js actions --- biome-lint/action.yml | 11 ++++++----- eslint-lint/action.yml | 11 ++++++----- pr-lint/action.yml | 10 +++++----- prettier-lint/action.yml | 11 ++++++----- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/biome-lint/action.yml b/biome-lint/action.yml index 7e88fca..d695935 100644 --- a/biome-lint/action.yml +++ b/biome-lint/action.yml @@ -143,12 +143,13 @@ runs: - name: Cache Node Dependencies id: cache - uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: - type: 'npm' - paths: 'node_modules' - key-files: 'package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lockb' - key-prefix: 'biome-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}' + path: node_modules + key: ${{ runner.os }}-biome-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}-${{ hashFiles('package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb') }} + restore-keys: | + ${{ runner.os }}-biome-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}- + ${{ runner.os }}-biome-lint-${{ inputs.mode }}- - name: Install Biome shell: bash diff --git a/eslint-lint/action.yml b/eslint-lint/action.yml index 33c9ccd..ad1f817 100644 --- a/eslint-lint/action.yml +++ b/eslint-lint/action.yml @@ -248,12 +248,13 @@ runs: - name: Cache Node Dependencies id: cache - uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: - type: 'npm' - paths: 'node_modules' - key-files: 'package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lockb' - key-prefix: 'eslint-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}' + path: node_modules + key: ${{ runner.os }}-eslint-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}-${{ hashFiles('package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb') }} + restore-keys: | + ${{ runner.os }}-eslint-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}- + ${{ runner.os }}-eslint-lint-${{ inputs.mode }}- - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' diff --git a/pr-lint/action.yml b/pr-lint/action.yml index 57dcf92..d7e04ed 100644 --- a/pr-lint/action.yml +++ b/pr-lint/action.yml @@ -84,12 +84,12 @@ runs: - name: Cache Node Dependencies if: steps.detect-node.outputs.found == 'true' id: node-cache - uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: - type: 'npm' - paths: 'node_modules' - key-files: 'package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lockb' - key-prefix: 'pr-lint-${{ steps.node-setup.outputs.package-manager }}' + path: node_modules + key: ${{ runner.os }}-pr-lint-${{ steps.node-setup.outputs.package-manager }}-${{ hashFiles('package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb') }} + restore-keys: | + ${{ runner.os }}-pr-lint-${{ steps.node-setup.outputs.package-manager }}- - name: Install Node Dependencies if: steps.detect-node.outputs.found == 'true' && steps.node-cache.outputs.cache-hit != 'true' diff --git a/prettier-lint/action.yml b/prettier-lint/action.yml index 0d98485..fbb75ff 100644 --- a/prettier-lint/action.yml +++ b/prettier-lint/action.yml @@ -229,12 +229,13 @@ runs: - name: Cache Node Dependencies id: cache - uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: - type: 'npm' - paths: 'node_modules' - key-files: 'package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lockb' - key-prefix: 'prettier-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}' + path: node_modules + key: ${{ runner.os }}-prettier-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}-${{ hashFiles('package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb') }} + restore-keys: | + ${{ runner.os }}-prettier-lint-${{ inputs.mode }}-${{ steps.node-setup.outputs.package-manager }}- + ${{ runner.os }}-prettier-lint-${{ inputs.mode }}- - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true'