Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmadnassri/action-npm-global-path
configure GitHub Actions to work with npm --global
https://github.com/ahmadnassri/action-npm-global-path
actions global npm path
Last synced: 22 days ago
JSON representation
configure GitHub Actions to work with npm --global
- Host: GitHub
- URL: https://github.com/ahmadnassri/action-npm-global-path
- Owner: ahmadnassri
- License: mit
- Created: 2021-02-24T20:04:36.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-13T21:26:56.000Z (about 1 year ago)
- Last Synced: 2024-05-02T05:33:57.550Z (7 months ago)
- Topics: actions, global, npm, path
- Language: Makefile
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# npm Global Path
configure GitHub Actions to work with npm --global
[![license][license-img]][license-url]
[![release][release-img]][release-url]
[![super linter][super-linter-img]][super-linter-url]
[![semantic][semantic-img]][semantic-url]GitHub Actions doesn't play nicely with `npm install --global` without `sudo`, nor does it allow it to be easily cached.
This Action will change npm's behavior to:
- use `npm install --global` without `sudo`
- change the global install path to `/packages`
- update the `$PATH` search path to include the new global npm install path for binary execution
- change the npm cache path to `/cache`## Usage
``` yaml
on: pushjobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/[email protected]
with:
key: ${{ hashFiles('**/package-lock.json') }}
path: |
~/.my-npm-stuff
node_modules- uses: ahmadnassri/action-npm-global-path@v1
with:
path: ~/.my-npm-stuff
```### Inputs
| input | required | default | description |
|-------|----------|----------|------------------|
| path | ❌ | `~/.npm` | root path to use |----
> Author: [Ahmad Nassri](https://www.ahmadnassri.com/) •
> Twitter: [@AhmadNassri](https://twitter.com/AhmadNassri)[license-url]: LICENSE
[license-img]: https://badgen.net/github/license/ahmadnassri/action-npm-global-path[release-url]: https://github.com/ahmadnassri/action-npm-global-path/releases
[release-img]: https://badgen.net/github/release/ahmadnassri/action-npm-global-path[super-linter-url]: https://github.com/ahmadnassri/action-npm-global-path/actions?query=workflow%3Asuper-linter
[super-linter-img]: https://github.com/ahmadnassri/action-npm-global-path/workflows/super-linter/badge.svg[semantic-url]: https://github.com/ahmadnassri/action-npm-global-path/actions?query=workflow%3Arelease
[semantic-img]: https://badgen.net/badge/📦/semantically%20released/blue