Skip to content

Add ability to select to install matching version already available on the current image#19

Open
nikolai-laevskii wants to merge 18 commits intomainfrom
prefer-installed
Open

Add ability to select to install matching version already available on the current image#19
nikolai-laevskii wants to merge 18 commits intomainfrom
prefer-installed

Conversation

@nikolai-laevskii
Copy link

@nikolai-laevskii nikolai-laevskii commented Sep 4, 2023

Description:
Adds ability to set preference for already installed versions when setting up dotnet environment. If prefer-installed flag is active, action will attempt to check already installed versions with dotnet utility. If matching version exists on the runner, request for this specific version will be passed to the install-script, which has ability to verify already installed version and skip download if current installation is not broken.

Related issue:
actions#356

Check list:

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

@dsame dsame self-assigned this Sep 6, 2023
* correct version number like '3.1.201', '3.1.201', '3.1.201', '3.1.201', '6.0.402'
*/
export const matchVersionToList = (version: string, versions: string[]) => {
if (!version || version === 'x' || version === '*') {
Copy link

Choose a reason for hiding this comment

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

Is not version argument is semver specification and semver matcher package can be used in order to match? Also version can be renamed to versionSpec then.

Copy link
Author

Choose a reason for hiding this comment

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

This is a good point, but semver doesn't seem to work correctly with 6.0.4xx version format, i.e:

semver.satisfies('6.0.402', '6.0.4xx') // -> false (should be true)

- add explicit return type for findMatching version function
- force version argument to be defined in createVersionArgument
- make dotnetVersion and quality properties readonly
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.

2 participants