feat: add support for latest alias

This commit is contained in:
Divlo 2021-07-01 14:54:34 +02:00
parent d0b685ffa8
commit 0418ee25e8
No known key found for this signature in database
GPG key ID: 185ED2F15F104E52
3 changed files with 16 additions and 2 deletions

View file

@ -57,6 +57,20 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} 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: [latest]
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: ./
with:
node-version: ${{ matrix.node-version }}
manifest: manifest:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:

2
dist/setup/index.js vendored
View file

@ -65299,7 +65299,7 @@ function queryDistForMatch(versionSpec, arch = os.arch()) {
} }
let versions = []; let versions = [];
let nodeVersions = yield module.exports.getVersionsFromDist(); let nodeVersions = yield module.exports.getVersionsFromDist();
if (versionSpec === 'current') { if (versionSpec === 'current' || versionSpec === 'latest') {
return nodeVersions[0].version; return nodeVersions[0].version;
} }
nodeVersions.forEach((nodeVersion) => { nodeVersions.forEach((nodeVersion) => {

View file

@ -373,7 +373,7 @@ async function queryDistForMatch(
let versions: string[] = []; let versions: string[] = [];
let nodeVersions = await module.exports.getVersionsFromDist(); let nodeVersions = await module.exports.getVersionsFromDist();
if (versionSpec === 'current') { if (versionSpec === 'current' || versionSpec === 'latest') {
return nodeVersions[0].version return nodeVersions[0].version
} }