diff --git a/.github/workflows/versions.yml b/.github/workflows/versions.yml index d13fe4024..6b299c1f3 100644 --- a/.github/workflows/versions.yml +++ b/.github/workflows/versions.yml @@ -43,6 +43,20 @@ jobs: with: node-version: ${{ matrix.node-version }} + latest-syntax: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: [node] + steps: + - uses: actions/checkout@v2 + - name: Setup Node + uses: ./ + with: + node-version: ${{ matrix.node-version }} + manifest: runs-on: ${{ matrix.os }} strategy: diff --git a/README.md b/README.md index e997b92e5..65acf7ac8 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ The `node-version` input supports the following syntax: major versions: `12`, `14`, `16` more specific versions: `10.15`, `14.2.0`, `16.3.0` nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*` +nvm latest version syntax: `node` ## Caching global packages data diff --git a/src/installer.ts b/src/installer.ts index a9baae0a1..3d713ae30 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -373,6 +373,10 @@ async function queryDistForMatch( let versions: string[] = []; let nodeVersions = await getVersionsFromDist(); + if (versionSpec === 'node') { + return nodeVersions[0].version; + } + nodeVersions.forEach((nodeVersion: INodeVersion) => { // ensure this version supports your os and platform if (nodeVersion.files.indexOf(dataFileName) >= 0) {