🚀 [Feature]: Version input accepts NuGet version ranges#98
Merged
Marius Storhaug (MariusStorhaug) merged 6 commits intoJul 9, 2026
Conversation
15 tasks
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 8, 2026 23:40
View session
There was a problem hiding this comment.
Pull request overview
This PR expands the action’s Version input to support NuGet version range syntax (as understood by PSResourceGet), and updates the “already installed” detection so satisfying installed versions can be reused instead of reinstalled on every run.
Changes:
- Update
src/init.ps1to useGet-InstalledPSResource -Version <range-or-version>(via splatted params) rather than exact string equality filtering. - Document version range support in
action.ymlandREADME.md, including examples and the “bare version is exact” note. - Add CI jobs in
.github/workflows/TestWorkflow.ymlto exercise exact versions, bounded/minimum ranges, and the “already installed” reuse behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/init.ps1 |
Adjusts installed-version detection to honor PSResourceGet version-range semantics. |
README.md |
Documents range syntax and provides a usage examples table for Version. |
action.yml |
Updates the Version input description to explicitly accept version ranges. |
.github/workflows/TestWorkflow.yml |
Adds workflow jobs validating exact and range behaviors plus reuse of satisfying installs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 8, 2026 23:47
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 8, 2026 23:52
View session
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.
The
Versioninput now accepts a NuGet version range in addition to an exact version, so a workflow can pin a compatible window (for example[1.2.0, 2.0.0)) instead of a single build. Pinning an exact version keeps working exactly as before, and a version that is already installed and satisfies the request is no longer reinstalled on every run.New: NuGet version ranges for the
VersioninputVersionaccepts the same syntax asInstall-PSResource:Versionexample1.2.31.2.3[1.2.3]1.2.3[1.2.0, ]1.2.0or newer(, 2.0.0)2.0.0[1.2.0, 2.0.0)1.2.0up to but not including2.0.0A bare version is treated as an exact version (not a minimum), so existing pins are unaffected. PSResourceGet resolves a range to the lowest satisfying version.
Fixed: a satisfying version is reused instead of reinstalled
Previously, supplying anything other than an exact version caused the module to be reinstalled on every run: the already-installed check compared the raw input to installed versions with exact string equality, which never matches a range. The check now honors ranges, so an already-installed version that satisfies the request is reused.
Technical Details
src/init.ps1: the already-installed lookup now passes the value toGet-InstalledPSResource -Name $Name -Version $Versioninstead of piping toWhere-Object Version -EQ. The redundantWhere-Object Prerelease -EQfilter was removed — prerelease handling is governed by the-Prereleaseswitch passed toInstall-PSResource. The retry loop (5 attempts, 10s delay) aroundInstall-PSResourceis unchanged.action.yml/README.md: theVersioninput is documented as accepting an exact version or a NuGet version range, with an examples table and a note that a bare version is exact..github/workflows/TestWorkflow.yml): addedVersion [Exact],Version [Bounded range],Version [Minimum range], andVersion [Already installed]jobs (Linux; version resolution is OS-independent). Written test-first — the already-installed job failed on the unfixed code (two installed versions) and passes after the fix. Because these jobs usePrerelease: ${{ inputs.Prerelease }}, they also exercise the prerelease + range combination when run viaAction-Test-Prerelease.yml.Backward compatibility: exact-version pins resolve identically; only the unnecessary-reinstall behavior changes.