Comments (13)
Going to close this issue for now (thank you for the awesome conversation though @felipecrs), as it seems like a more general feature request over in volta itself.
from action.
RE: the volta internals, I think we'd need volta-cli/volta#282 to be resolved to avoid mutating package.json
from action.
Is it by running volta pin node@version?
Yep!
If so, does it leave the package.json modified?
Yes, it does. This is somewhat intentional, as I'm not sure where the package.json would be reversed. During the full run of the workflow (I suppose until the next run of the volta-cli/action action again) the node/yarn/npm versions specified in the actions config should "override" whatever happens to be in package.json
.
from action.
I think this is a feature request for volta instead:
Support running temporary node versions
from action.
Support running temporary node versions
Hmm, I think this already exists.
Volta run --node=8 npm test
from action.
But it's not suitable for this action for example. It would be something like:
volta use node@8
from action.
I guess I don't understand what you are asking for. Currently we support two main modes of operation:
- pinning the project via node-version / yarn-version -- This would be used for the remainder of the action (or until the next invocation of the action changing node-version / yarn-version)
- using
volta run
-- This would run a specific command with the associated node / yarn versions; not modifying anything about future command line invocations.
What sort of timing / lifetime are you looking for?
from action.
I'm just looking for something that could be used by this action
without changing package.json
.
from action.
Why does the mutation of package.json matter in your case? Is there something that the current volta pin
style override system breaks for your setup?
from action.
I use semantic-release
in most of my projects, and during its execution, it updates the package.json
with the new version to release, and commit this change back to GitHub.
In my case, I'm safe, since I don't call semantic-release
in the same job which I set custom versions of node
with volta
.
Nonetheless, I can think of 2 cases where this would break:
-
For those who don't call
semantic-release
in a separate job (as advised in their own documentation, it only needs to be called after thenpm test
, not in other jobs AND the user uses this action to set thenode
version to run. Thesemantic-release
would commit the newly pinned version of node back to GitHub. -
For those who can use this action without pinning their versions in
package.json
, and still usessemantic-release
. The semantic-release would commit the pinned version of node back to GitHub.
Side note: I'm now thinking about doing this deliberately, so I can keep my node
and npm
versions up-to-date automatically. :)
References volta-cli/volta#905.
from action.
Thanks for the explanation! I'm not sure there is a reasonable solution we can do here though. I can't think of a good heuristic that would allow us to reset that wouldn't also be annoying for non-release cases.
from action.
I thought in something like:
volta set node@8
-> writes the current directory and the desired version of node to$VOLTA_TEMP/set.json
node
shim check for$VOLTA_TEMP/set.json
before checking forpackage.json
volta unset node
-> removes node from$VOLTA_TEMP/set.json
If you'd like, I can move this discussion to the main volta repo.
But for this repo, I think the current behavior should be documented, so the users would be at least aware of the package.json
becoming (git) dirty in their pipelines.
from action.
But for this repo, I think the current behavior should be documented, so the users would be at least aware of the package.json becoming (git) dirty in their pipelines.
Yes, sounds good to me.
from action.
Related Issues (20)
- Using volta-cli/action on GitHub Enterprise Server causes frequent rate-limits with no fallback HOT 1
- Prepare for 1.1.0 Support
- Action fails to download `[email protected]` HOT 8
- Support pnpm cache
- Add support for windows platform HOT 1
- Testing Against Multiple Node Versions HOT 2
- Set up eslint and tsc problem matchers? HOT 1
- Use @action/cache to cache where possible HOT 9
- Add support for choosing a volta version by "version spec" HOT 1
- Support `actions/setup-node`'s `registry-url` input HOT 2
- Pre-Packaged Actions Unable to Locate Executables HOT 6
- Support `npm-version` HOT 1
- Frequent failures HOT 13
- Object prototype may only be an Object or null: undefined HOT 4
- Please release HOT 3
- Unexpected input(s) 'registry-url' HOT 1
- package.json in a subdirectory HOT 1
- Should be released with major `v2` tag HOT 2
- Unexpected input(s) 'scope' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action.