From 628dd514852da62b8e0c9b30658eee46e950d46d Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Thu, 23 Jan 2020 08:47:21 +0100 Subject: [PATCH] Document supported SemVer ranges with example --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61d93040..763280ba 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ GitHub Actions status

-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 - 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) +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: ```yaml steps: