mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
feat: add support for latest
alias
This commit is contained in:
parent
d0b685ffa8
commit
0418ee25e8
3 changed files with 16 additions and 2 deletions
14
.github/workflows/versions.yml
vendored
14
.github/workflows/versions.yml
vendored
|
@ -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
2
dist/setup/index.js
vendored
|
@ -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) => {
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue