-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow canary releases #605
Conversation
…anov/setup-node into v-sedoli/lkgr
|
||
return version; | ||
} | ||
|
||
// TODO - should we just export this from @actions/tool-cache? Lifted directly from there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment isn't relevant anymore since we're changing the logic
versions = versions.sort((a, b) => { | ||
if (semver.gt(a, b)) { | ||
return 1; | ||
} | ||
return -1; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a compare
function you can pass to Array.prototype.sort
: https://github.com/npm/node-semver#comparison
versions = versions.sort((a, b) => { | |
if (semver.gt(a, b)) { | |
return 1; | |
} | |
return -1; | |
}); | |
versions = versions.sort(semver.compare); |
const versionsReversed = versions.sort((a, b) => { | ||
if (semver.gt(a, b)) { | ||
return -1; | ||
} else if (semver.lt(a, b)) { | ||
return 1; | ||
} | ||
return 0; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also an rcompare
function:
const versionsReversed = versions.sort((a, b) => { | |
if (semver.gt(a, b)) { | |
return -1; | |
} else if (semver.lt(a, b)) { | |
return 1; | |
} | |
return 0; | |
}); | |
const versionsReversed = versions.sort(semver.rcompare); |
versionSpec: string | ||
): string { | ||
let version = ''; | ||
let range: string | null | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let range: string | null | undefined; | |
let range: string | undefined; |
doesn't look like it's ever null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor suggestions but looks good
versionSpec: string | ||
): string { | ||
let version = ''; | ||
let range: string | null | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let range: string | null | undefined; | |
let range: string | undefined; |
doesn't look like it's ever null
?
206b7e5
to
8285caf
Compare
76c3871
to
21dbe7e
Compare
The PR to be abandoned for sake of this PR #619 |
I'm going to close the pull request in favour of this: #655 |
Description:
https://github.com/actions/runner-images-internal/issues/4457
Related issue:
Add link to the related issue.
Check list: