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.
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.
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.
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.
| let range: string | null | undefined; | |
| let range: string | undefined; |
doesn't look like it's ever null?
brcrista
left a comment
There was a problem hiding this comment.
A few minor suggestions but looks good
| versionSpec: string | ||
| ): string { | ||
| let version = ''; | ||
| let range: string | null | undefined; |
There was a problem hiding this comment.
| 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: