Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

🦆 GitHub action to cache Yarn, NPM, and PNPM cache directories!

License

Notifications You must be signed in to change notification settings

AugustArchive/node-pm-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date
Aug 1, 2022
Feb 1, 2023
Dec 17, 2022
Aug 1, 2022
Aug 1, 2022
Aug 1, 2022
Aug 1, 2022
Aug 1, 2022
Aug 1, 2022
Feb 1, 2023
Aug 1, 2022
Aug 1, 2022
Aug 1, 2022
Feb 14, 2023
Aug 1, 2022
Aug 1, 2022
Feb 14, 2023

Repository files navigation

🦆 Node Package Managers Cache

GitHub action to cache Yarn, NPM, and PNPM cache directories!

node-pm-cache is a GitHub Action to cache Yarn, NPM, and PNPM caching directories alongside with node_modules so your workflows can go speed! ⚡

Example Workflow

name: My Workflow
on:
  push: {}
jobs:
  workflow:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup Node.js 18
        uses: actions/setup-node@v3
        with:
          node-version: 18.x

      - name: Cache Yarn and node-modules
        uses: auguwu/node-pm-cache@master
        with:
          node-modules: ./node_modules
          package-manager: yarn # Leave this out to let the action to detect it.

This will produce a cache bundle with the following keys:

  • <pm>-<os>-<node-version>-<hashed yarn.lock/package-lock.json/pnpm-lockfile.yaml>

Inputs

Name Type Description Required? Default Value
node-modules Path (relative or absolute) The node-modules directory to cache. false ./node_modules
package-manager pnpm/yarn/npm/detect The package manager to cache objects. false "detect"

Outputs

Name Type Description
cache-hit Boolean If the package manager cache was already cached and it was restored.
package-manager pnpm/yarn/npm The package manager that was used.
lockfile Path (absolute) The lockfile path that was used to hash the primary cache key.
node-modules-cache-hit Boolean If the node-modules directory was cached (and restored) or not.

License

node-pm-cache is released under the MIT License with love ☆⌒ ヽ(*'、^*)chu by Noel. :3