Skip to content

Honor the Run_Container action input #80

Description

Context and request

Observed behavior: Run_Container arrives as a string. The action passes it through ConvertTo-Hashtable, producing string metadata such as @{ Length = 15 }, and later splats that value into New-PesterContainer. Pester rejects the unsupported Length parameter.

Expected behavior: The action accepts a documented serialized container representation and creates the requested Pester containers, or rejects invalid input before execution with a clear error.

Reproduction:

- uses: PSModule/Invoke-Pester@v3
  with:
    Run_Container: container-value

The execution path attempts New-PesterContainer -Length 15 rather than constructing a ContainerInfo object.

Environment: GitHub composite action; verified against the Pester 6.1.0 container command. Direct string values are also discarded by Pester 5.8.0 and 6.1.0 configuration conversion.

Regression: Unknown. The declared action input does not currently define a transport format capable of preserving ContainerInfo objects.

Workaround: Reference .Container.ps1 files through Path, or define containers in a PowerShell configuration file.

Acceptance criteria

  • Add an action-level regression test demonstrating the current invalid conversion.
  • Define a stable serialized input contract for one or more containers.
  • Validate and deserialize the input without treating string properties as container parameters.
  • Construct the expected Pester containers on supported Pester versions.
  • Document the supported format and validation failures.

Technical decisions

GitHub Action inputs are scalar strings, while Pester expects ContainerInfo[]. The fix must define that boundary explicitly rather than relying on generic object-to-hashtable conversion.

Implementation plan

  1. Add the failing regression test.
  2. Select and document the serialized container schema.
  3. Add strict parsing and validation.
  4. Construct the containers and verify execution with supported Pester versions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    github_actionsPull requests that update GitHub Actions code

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions