Skip to content

v5.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Jul 13:46
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:

- uses: PSModule/Invoke-ScriptAnalyzer@v1
  with:
    Version: '[1.2.0, 2.0.0)'      # was the GitHub module
    Prerelease: 'true'

After:

- 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-Modules 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/GitHubPrereleaseGitHubVersion/GitHubPrerelease.
  • Get-TestPaths (GitHub-Script) step: Version/PrereleaseGitHubVersion/GitHubPrerelease.
  • README.md: inputs table updated to document all six version inputs.