FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow canary releases by dsame · Pull Request #605 · actions/setup-node · GitHub

Allow canary releases - #605

Closed
dsame wants to merge 16 commits into
actions:mainfrom
akv-platform:v-sedoli/lkgr
Closed

Allow canary releases#605
dsame wants to merge 16 commits into
actions:mainfrom
akv-platform:v-sedoli/lkgr

Conversation

dsame commented Oct 24, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Description:
https://github.com/actions/runner-images-internal/issues/4457

Related issue:
Add link to the related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

dsame requested a review from a team October 24, 2022 07:22
Comment thread src/installer.ts
return version;
}

// TODO - should we just export this from @actions/tool-cache? Lifted directly from there

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This comment isn't relevant anymore since we're changing the logic

Comment thread src/installer.ts
Comment on lines +391 to +409
versions = versions.sort((a, b) => {
if (semver.gt(a, b)) {
return 1;
}
return -1;
});

brcrista Oct 25, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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);

Comment thread src/installer.ts
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;
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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);

Comment thread src/installer.ts
versionSpec: string
): string {
let version = '';
let range: string | null | undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
let range: string | null | undefined;
let range: string | undefined;

doesn't look like it's ever null?

brcrista left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A few minor suggestions but looks good

Comment thread src/installer.ts
versionSpec: string
): string {
let version = '';
let range: string | null | undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
let range: string | null | undefined;
let range: string | undefined;

doesn't look like it's ever null?

dsame force-pushed the v-sedoli/lkgr branch 6 times, most recently from 206b7e5 to 8285caf Compare November 2, 2022 20:50
dsame force-pushed the v-sedoli/lkgr branch 6 times, most recently from 76c3871 to 21dbe7e Compare November 3, 2022 20:00

dsame commented Nov 11, 2022

Copy link
Copy Markdown
Contributor Author

The PR to be abandoned for sake of this PR #619

Copy link
Copy Markdown
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL