Skip to content

Add regression test: init.ps1 replaces a pre-loaded GitHub module version with the selected one #101

Description

Context

PR #100 makes GitHub-Script's init.ps1 deterministically load the GitHub module version selected via the Version/Prerelease inputs: it removes any already-loaded instances and imports the resolved version with -RequiredVersion -Force -Global. The core guarantee is that a different GitHub module version already imported before the action runs gets replaced by the selected one.

The existing ActionTest matrix covers version selection (exact / range / already-installed), but there is no regression test for the specific scenario the change fixes: a different GitHub module version is already imported into the session before init.ps1 runs.

Request

Add an integration test that:

  • Pre-imports a GitHub module version that differs from the one the action will select (e.g. Import-Module GitHub -RequiredVersion <old> before invoking the action, or via a Prescript/setup step).
  • Runs the action with Version pinned to a different version.
  • Asserts that after init the loaded module (Get-Module GitHub) is exactly the selected version and that no other version remains loaded.

Acceptance criteria

Raised from Copilot review feedback on #100.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions