• Stars
    star
    741
  • Rank 58,816 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Install pnpm package manager

Setup pnpm

Install pnpm package manager.

Inputs

version

Version of pnpm to install.

Optional when there is a packageManager field in the package.json.

otherwise, this field is required It supports npm versioning scheme, it could be an exact version (such as 6.24.1), or a version range (such as 6, 6.x.x, 6.24.x, ^6.24.1, *, etc.), or latest.

dest

Optional Where to store pnpm files.

run_install

Optional (default: null) If specified, run pnpm install.

If run_install is either null or false, pnpm will not install any npm package.

If run_install is true, pnpm will install dependencies recursively.

If run_install is a YAML string representation of either an object or an array, pnpm will execute every install commands.

run_install.recursive

Optional (type: boolean, default: false) Whether to use pnpm recursive install.

run_install.cwd

Optional (type: string) Working directory when run pnpm [recursive] install.

run_install.args

Optional (type: string[]) Additional arguments after pnpm [recursive] install, e.g. [--frozen-lockfile, --strict-peer-dependencies].

package_json_file

Optional (type: string, default: package.json) File path to the package.json to read "packageManager" configuration.

standalone

Optional (type: boolean, default: false) When set to true, @pnpm/exe, which is a Node.js bundled package, will be installed, enabling using pnpm without Node.js.

This is useful when you want to use a incompatible pair of Node.js and pnpm.

Outputs

dest

Expanded path of inputs#dest.

bin_dest

Location of pnpm and pnpx command.

Usage example

Just install pnpm

on:
  - push
  - pull_request

jobs:
  install:
    runs-on: ubuntu-latest

    steps:
      - uses: pnpm/action-setup@v2
        with:
          version: 8

Install pnpm and a few npm packages

on:
  - push
  - pull_request

jobs:
  install:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: pnpm/action-setup@v2
        with:
          version: 8
          run_install: |
            - recursive: true
              args: [--frozen-lockfile, --strict-peer-dependencies]
            - args: [--global, gulp, prettier, typescript]

Use cache to reduce installation time

on:
  - push
  - pull_request

jobs:
  cache-and-install:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16

      - uses: pnpm/action-setup@v2
        name: Install pnpm
        with:
          version: 7
          run_install: false

      - name: Get pnpm store directory
        shell: bash
        run: |
          echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

      - uses: actions/cache@v3
        name: Setup pnpm cache
        with:
          path: ${{ env.STORE_PATH }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

      - name: Install dependencies
        run: pnpm install

Note: You don't need to run pnpm store prune at the end; post-action has already taken care of that.

Notes

This action does not setup Node.js for you, use actions/setup-node yourself.

License

MIT © Hoàng Văn Khải

More Repositories

1

pnpm

Fast, disk space efficient package manager
TypeScript
27,233
star
2

pacquet

experimental package manager for node.js
Rust
748
star
3

only-allow

Force a specific package manager to be used on a project
JavaScript
530
star
4

benchmarks-of-javascript-package-managers

Benchmarks of JavaScript Package Managers
JavaScript
443
star
5

pnpm.io

pnpm's website
JavaScript
192
star
6

pn

This is an experimental wrapper over the pnpm CLI written in Rust
Rust
82
star
7

awesome-pnpm

Awesome pnpm resources
77
star
8

symlink-dir

Cross-platform directory symlinking
TypeScript
68
star
9

meta-updater

TypeScript
50
star
10

supi

Fast, disk space efficient installation engine. Used by pnpm
TypeScript
24
star
11

reflink

JavaScript
23
star
12

rfcs

16
star
13

get.pnpm.io

JavaScript
16
star
14

registry-mock

Mock the npm registry
JavaScript
15
star
15

merge-driver

A merge driver for pnpm-lock.yaml
TypeScript
15
star
16

sample-project

A sample project demonstrating the results of installing with pnpm
14
star
17

self-installer

Installs pnpm
JavaScript
13
star
18

docker-pnpm

Automated docker image with pnpm pre-installed
Shell
12
star
19

get-npm-tarball-url

Create the tarball URL of a npm package
TypeScript
11
star
20

hook-utils

A helper for pnpmfile.js files
TypeScript
8
star
21

spec

pnpm specifications
8
star
22

exec

Executes pnpm. If pnpm is not installed, installs it first
TypeScript
6
star
23

node-modules-check

Checks packages in node_modules
TypeScript
5
star
24

graph-sequencer

JavaScript
5
star
25

ecosystem-issues

5
star
26

link-bins

Link bins to node_modules/.bin
TypeScript
4
star
27

pnpm-default-reporter

The default reporter of pnpm
TypeScript
4
star
28

semver-diff

Gets the difference between two semver versions
TypeScript
4
star
29

parse-codeload-url

Parse a tarball URL hosted on codeload.github.com
TypeScript
4
star
30

parse-npm-tarball-url

Parse a tarball URL hosted in the npm registry
TypeScript
3
star
31

pnpm-shrinkwrap

pnpm's shrinkwrap
TypeScript
3
star
32

store-path

Resolves the pnpm store path
TypeScript
3
star
33

logger

Logger for pnpm
TypeScript
3
star
34

encode-registry

Encodes a registry URL. Memoized.
JavaScript
2
star
35

remove-all-except-outer-links

Removes everything from a folder except external symlinks
JavaScript
2
star
36

tarball-fetcher

Fetcher for packages hosted as tarballs
TypeScript
2
star
37

file-reporter

A file reporter for pnpm
TypeScript
2
star
38

components

TypeScript
2
star
39

pnpm-simple-reporter

A simple reporter for pnpm
TypeScript
2
star
40

pnpm-list

List installed packages in a symlinked `node_modules`
TypeScript
2
star
41

colorize-semver-diff

Makes a colorful semver diff
TypeScript
2
star
42

fetch-from-npm-registry

A fetch lib specifically for using with the npm registry
TypeScript
2
star
43

npm-resolver

Resolver for npm-hosted packages
TypeScript
1
star
44

credentials-by-uri

Gets credentials for URI from npm configs
JavaScript
1
star
45

normalize-registry-url

Normalizes a npm registry URL
JavaScript
1
star
46

lib

1
star
47

package-requester

Concurrent downloader of npm-compatible packages
TypeScript
1
star
48

check-package

Checks the integrity of a package
TypeScript
1
star
49

fs-locker

An fs locker for pnpm
TypeScript
1
star
50

manifesto

The pnpm manifesto
1
star
51

package-store

A storage for npm packages. Used by pnpm
TypeScript
1
star
52

version-selector-type

Returns the type of a version selector
JavaScript
1
star
53

pkgid-to-filename

Converts a package ID to a valid file name
TypeScript
1
star
54

resolver-base

Types for pnpm-compatible resolvers
TypeScript
1
star
55

pnpm-bin-runner

A bin runner for pnpm
TypeScript
1
star
56

default-fetcher

pnpm's default package fetcher
TypeScript
1
star
57

test-git-fetch

JavaScript
1
star
58

tarball-resolver

Resolver for tarball dependencies
TypeScript
1
star
59

redirects

1
star
60

modules-yaml

Reads/writes node_modules/.modules.yaml
TypeScript
1
star
61

.github

1
star
62

pnpm-install-checks

A package that contains checks that pnpm runs during the installation.
JavaScript
1
star
63

lifecycle

Package lifecycle hook runner
TypeScript
1
star
64

headless

Fast installation using only shrinkwrap.yaml
TypeScript
1
star
65

read-package-json

TypeScript
1
star
66

dependency-path

Utilities for working with symlinked node_modules
TypeScript
1
star
67

server

A pnpm installer server
TypeScript
1
star
68

testimonials

Testimonials about pnpm
1
star
69

outdated

Check for outdated packages
TypeScript
1
star
70

fetcher-base

Types for pnpm-compatible fetchers
TypeScript
1
star
71

default-resolver

pnpm's default package resolver
TypeScript
1
star
72

types

Basic types used by pnpm
TypeScript
1
star
73

assert-project

Utils for testing projects that use pnpm
TypeScript
1
star
74

git-fetcher

Fetcher for git-hosted packages
TypeScript
1
star
75

pnpmr

Deprecated. Use the `pnpm recursive` commands instead
JavaScript
1
star
76

local-resolver

Resolver for local packages
TypeScript
1
star
77

package-bins

Returns bins of a package
TypeScript
1
star
78

dependencies-hierarchy

Creates a dependencies hierarchy for a symlinked node_modules
TypeScript
1
star
79

git-resolver

Resolver for git-hosted packages
TypeScript
1
star