GithubHelp home page GithubHelp logo

Add setup-node code to examples about action-setup HOT 7 OPEN

pnpm avatar pnpm commented on May 26, 2024
Add setup-node code to examples

from action-setup.

Comments (7)

KSXGitHub avatar KSXGitHub commented on May 26, 2024 1

So to be on the safer side, so that your actions won't error out, can we always use setup node (though pnpm doesn't need it) as a best practice.

Yes. This action does not care about whatever version setup-node installs. And whatever version this action uses does not affect your code.

from action-setup.

KSXGitHub avatar KSXGitHub commented on May 26, 2024 1

@melMass I will accept a PR that adds a code example that use pnpm/action-setup and actions/setup-node with cache key. There is already a section called "Use cache to reduce installation time" in README.md, you may rename it to "With actions/cache" (or something) and add another section named "Use the cache key in actions/setup-node".

from action-setup.

KSXGitHub avatar KSXGitHub commented on May 26, 2024

This action by itself does not require setup-node, and isn't affected by setup-node, so you'll need to add that clarification in the example. I'll be waiting for your PR.

from action-setup.

rajasegar avatar rajasegar commented on May 26, 2024

This action by itself does not require setup-node, and isn't affected by setup-node, so you'll need to add that clarification in the example. I'll be waiting for your PR.

What do you mean by itself does not require setup-node? Are you implying without setup-node this action alone will work? How can we set something like what version of Node.js to use with this action without setup-node?

from action-setup.

KSXGitHub avatar KSXGitHub commented on May 26, 2024

Are you implying without setup-node this action alone will work?

Yes. But only for installing pnpm. User still have to use setup-node to run their own JavaScript code.

How can we set something like what version of Node.js to use with this action without setup-node?

The action will not let user specify what Node.js version the action use because it is an implementation detail. Besides, the Node.js version that pnpm uses is irrelevant to the dependencies it installs, why do you care about it anyway?

from action-setup.

rajasegar avatar rajasegar commented on May 26, 2024

I often end up changing my node version for specific jobs in the workflows like semantic-release, that's why I specifically need to set the node version.
So to be on the safer side, so that your actions won't error out, can we always use setup node (though pnpm doesn't need it) as a best practice.

from action-setup.

melMass avatar melMass commented on May 26, 2024

I agree that a full on example would be great 🙏
Trying to use it right now and they suggest setting the cache key to the package manager used pnpm in my case but I have the following error:

image

Edit: Well for my case it happened to be simpler than I thought pnpm must be installed BEFORE Node.js

More info here: https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies

from action-setup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.