Closed
Conversation
…anov/setup-node into v-sedoli/lkgr
brcrista
reviewed
Oct 25, 2022
| return version; | ||
| } | ||
|
|
||
| // TODO - should we just export this from @actions/tool-cache? Lifted directly from there |
Contributor
There was a problem hiding this comment.
This comment isn't relevant anymore since we're changing the logic
brcrista
reviewed
Oct 25, 2022
Comment on lines
+391
to
+409
| versions = versions.sort((a, b) => { | ||
| if (semver.gt(a, b)) { | ||
| return 1; | ||
| } | ||
| return -1; | ||
| }); |
Contributor
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
Suggested change
| versions = versions.sort((a, b) => { | |
| if (semver.gt(a, b)) { | |
| return 1; | |
| } | |
| return -1; | |
| }); | |
| versions = versions.sort(semver.compare); |
brcrista
reviewed
Oct 25, 2022
Comment on lines
+438
to
+458
| const versionsReversed = versions.sort((a, b) => { | ||
| if (semver.gt(a, b)) { | ||
| return -1; | ||
| } else if (semver.lt(a, b)) { | ||
| return 1; | ||
| } | ||
| return 0; | ||
| }); |
Contributor
There was a problem hiding this comment.
There's also an rcompare function:
Suggested change
| 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); |
brcrista
reviewed
Oct 25, 2022
| versionSpec: string | ||
| ): string { | ||
| let version = ''; | ||
| let range: string | null | undefined; |
Contributor
There was a problem hiding this comment.
Suggested change
| let range: string | null | undefined; | |
| let range: string | undefined; |
doesn't look like it's ever null?
brcrista
approved these changes
Oct 25, 2022
Contributor
brcrista
left a comment
There was a problem hiding this comment.
A few minor suggestions but looks good
marko-zivic-93
approved these changes
Oct 26, 2022
brcrista
reviewed
Oct 26, 2022
| versionSpec: string | ||
| ): string { | ||
| let version = ''; | ||
| let range: string | null | undefined; |
Contributor
There was a problem hiding this comment.
Suggested change
| let range: string | null | undefined; | |
| let range: string | undefined; |
doesn't look like it's ever null?
2 tasks
206b7e5 to
8285caf
Compare
76c3871 to
21dbe7e
Compare
Contributor
Author
|
The PR to be abandoned for sake of this PR #619 |
Contributor
|
I'm going to close the pull request in favour of this: #655 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
https://github.com/actions/runner-images-internal/issues/4457
Related issue:
Add link to the related issue.
Check list: