Commit 4d633e4
🌟 [Major]: Control PSScriptAnalyzer, Pester, and GitHub module versions (#32)
Bumps `PSModule/Invoke-Pester` from 4.2.4 to 5.1.0 and reworks the
action's version inputs so callers can independently pin the three
modules the action relies on — and guarantees the pinned versions are
the ones actually installed and loaded.
Each module now follows the same convention used by its dedicated
action, where the bare `Version`/`Prerelease` controls the namesake
module:
| Input | Controls |
|---|---|
| `Version` / `Prerelease` | PSScriptAnalyzer (this action's namesake
module) |
| `PesterVersion` / `PesterPrerelease` | Pester |
| `GitHubVersion` / `GitHubPrerelease` | GitHub module |
## New: `Version` / `Prerelease` pin PSScriptAnalyzer
The action now provisions the PSScriptAnalyzer module itself instead of
relying on whatever copy is preinstalled on the runner. It installs the
requested version (NuGet version-range syntax, for example `[1.0.0,
2.0.0)`; empty installs the latest), removes any other PSScriptAnalyzer
version from the session, and imports the chosen version — so the
analysis runs against exactly the version you selected.
## New: `PesterVersion` / `PesterPrerelease` and `GitHubVersion` /
`GitHubPrerelease`
Control the Pester module (the test runner) and the GitHub module (used
to resolve paths and emit results) independently, both using NuGet
version-range syntax.
## Breaking Changes
`Version` and `Prerelease` changed meaning: they previously controlled
the **GitHub** module; they now control **PSScriptAnalyzer**. Callers
that pinned the GitHub module must switch to `GitHubVersion` /
`GitHubPrerelease`.
Before:
```yaml
- uses: PSModule/Invoke-ScriptAnalyzer@v1
with:
Version: '[1.2.0, 2.0.0)' # was the GitHub module
Prerelease: 'true'
```
After:
```yaml
- uses: PSModule/Invoke-ScriptAnalyzer@v2
with:
Version: '[1.0.0, 2.0.0)' # PSScriptAnalyzer
GitHubVersion: '[1.2.0, 2.0.0)' # GitHub module
PesterVersion: '[6.0.0, 7.0.0)' # Pester
```
## Technical Details
- `action.yml`: `Version`/`Prerelease` (PSScriptAnalyzer) added;
`PesterVersion`/`PesterPrerelease` and
`GitHubVersion`/`GitHubPrerelease` retained.
- `src/Install-PSScriptAnalyzer.ps1` (new): installs the requested
PSScriptAnalyzer version (with PSGallery retry), `Remove-Module`s any
loaded copy, then `Import-Module -RequiredVersion … -Global` for the
resolved version. Wired via the Invoke-Pester step's `Prescript` input,
so it runs in the same process as the analyzer run
(`Version`/`Prerelease` passed through as env).
- `Invoke-Pester` step bumped to v5.1.0 (SHA
`4ff33199141fdf22568990b6107fe3148ae93a1c`): its `Version`/`Prerelease`
(Pester) ← `PesterVersion`/`PesterPrerelease`; its
`GitHubVersion`/`GitHubPrerelease` ← `GitHubVersion`/`GitHubPrerelease`.
- `Get-TestPaths` (`GitHub-Script`) step: `Version`/`Prerelease` ←
`GitHubVersion`/`GitHubPrerelease`.
- `README.md`: inputs table updated to document all six version inputs.
---------
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Storhaug <marstor@hotmail.com>1 parent f3cbd69 commit 4d633e4
3 files changed
Lines changed: 113 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
29 | 49 | | |
30 | 50 | | |
31 | 51 | | |
| |||
255 | 275 | | |
256 | 276 | | |
257 | 277 | | |
258 | | - | |
| 278 | + | |
259 | 279 | | |
260 | | - | |
| 280 | + | |
261 | 281 | | |
262 | 282 | | |
263 | 283 | | |
264 | 284 | | |
265 | | - | |
| 285 | + | |
266 | 286 | | |
267 | 287 | | |
268 | 288 | | |
| 289 | + | |
| 290 | + | |
269 | 291 | | |
270 | 292 | | |
271 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
272 | 296 | | |
273 | | - | |
| 297 | + | |
274 | 298 | | |
275 | 299 | | |
| 300 | + | |
276 | 301 | | |
277 | 302 | | |
278 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments