mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
Document supported SemVer ranges with example
This commit is contained in:
parent
9a99bb3e35
commit
628dd51485
1 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
||||||
<a href="https://github.com/actions/setup-node"><img alt="GitHub Actions status" src="https://github.com/actions/setup-node/workflows/Main%20workflow/badge.svg"></a>
|
<a href="https://github.com/actions/setup-node"><img alt="GitHub Actions status" src="https://github.com/actions/setup-node/workflows/Main%20workflow/badge.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
This action sets by node environment for use in actions by:
|
This action sets the node environment for use in actions by:
|
||||||
|
|
||||||
- optionally downloading and caching a version of node - npm by version spec and add to PATH
|
- optionally downloading and caching a version of node - npm by version spec and add to PATH
|
||||||
- registering problem matchers for error output
|
- registering problem matchers for error output
|
||||||
|
@ -13,6 +13,12 @@ This action sets by node environment for use in actions by:
|
||||||
|
|
||||||
See [action.yml](action.yml)
|
See [action.yml](action.yml)
|
||||||
|
|
||||||
|
You can use any valid [SemVer](https://semver.org/) range supported by the [sem-ver](https://www.npmjs.com/package/semver#ranges) module.
|
||||||
|
|
||||||
|
For example [`node-version: '*'`](https://www.npmjs.com/package/semver#x-ranges-12x-1x-12-) would satisfy the latest version.
|
||||||
|
|
||||||
|
See also the [`evaluateVersions`](https://github.com/actions/setup-node/blob/93313caf82afbdb49b8e4790ac7f1c97c8034826/src/installer.ts#L114) method and its usage of [`semver.satisfies`](https://github.com/actions/setup-node/blob/93313caf82afbdb49b8e4790ac7f1c97c8034826/src/installer.ts#L130)
|
||||||
|
|
||||||
Basic:
|
Basic:
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
|
|
Loading…
Add table
Reference in a new issue