Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jan 7, 2026

This release introduces a new GitHub Action, Get-PSModuleSettings, which replaces the previous template action in PSModule/Process-PSModule. The action is designed to load and process PowerShell module workflow settings from configuration files, compute job run conditions, and output structured settings and test suite information for use in CI pipelines.

How It Works

The Get-PSModuleSettings action:

  1. Loads settings from a specified configuration file (supporting JSON, YAML, or PSD1 formats)
  2. Validates settings against a comprehensive JSON schema to ensure correctness
  3. Applies defaults for any missing configuration values
  4. Generates test suite matrices for multiple operating systems (Linux, macOS, Windows) based on test discovery
  5. Computes job run conditions based on PR state (open, updated, merged, abandoned)
  6. Outputs structured JSON containing all settings, test suites, and run conditions for downstream workflow steps

Configuration Format Support

The action supports three configuration formats:

  • JSON - Standard JSON configuration files
  • YAML/YML - Human-readable YAML format
  • PSD1 - PowerShell Data File format (native PowerShell hashtables)

Test Suite Generation

The action automatically discovers and categorizes tests into three types:

  • SourceCode tests - Static analysis and linting of source code
  • PSModule tests - Tests for the built PowerShell module
  • Module tests - Integration and functional tests with test matrices for each OS

Test discovery supports:

  • *.Configuration.ps1 - Test configuration files
  • *.Container.ps1 - Test container files
  • *.Tests.ps1 - Standard Pester test files

Job Run Conditions

The action calculates intelligent run conditions for each workflow job based on:

  • Pull request state (open, updated, merged, abandoned)
  • Configuration skip flags
  • Test suite availability
  • Ensures abandoned PRs don't waste CI resources

Copilot AI review requested due to automatic review settings January 7, 2026 17:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new GitHub Action called Get-PSModuleSettings that replaces the previous template action. The action loads PowerShell module workflow settings from configuration files (JSON, YAML, or PSD1 formats), processes test suite configurations, computes job run conditions, and outputs structured settings for use in CI pipelines.

Key changes include:

  • Complete rewrite of the main script logic to handle settings file parsing and test suite generation
  • New action definition with settings-focused inputs/outputs replacing the template greeting action
  • Addition of test configuration file and validation workflow steps

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
scripts/main.ps1 Complete rewrite from template to settings processing logic with test suite generation and job condition calculation
action.yml Renamed from Template-Action to Get-PSModuleSettings with new inputs (SettingsPath) and outputs (Settings JSON)
tests/PSModule.yml New test configuration file with module test settings including skip flags and linter environment variables
tests/README.md Removed placeholder content
.github/workflows/Action-Test.yml Updated to test the new action with settings validation steps for outputs
.github/workflows/Linter.yml Added linter validation exclusions for biome, zizmor, and jscpd

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 7, 2026 19:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 7, 2026 21:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 7, 2026 21:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 7, 2026 21:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 11, 2026 01:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

TestModule = $isNotAbandonedPR -and ($null -ne $settings.TestSuites.PSModule)
BeforeAllModuleLocal = $isNotAbandonedPR -and ($null -ne $settings.TestSuites.Module)
TestModuleLocal = $isNotAbandonedPR -and ($null -ne $settings.TestSuites.Module)
AfterAllModuleLocal = $true # Always runs if Test-ModuleLocal was not skipped
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "Always runs if Test-ModuleLocal was not skipped" but the condition is simply $true without checking whether Test-ModuleLocal actually ran. This means AfterAllModuleLocal will always be set to true, even when TestModuleLocal is false (which happens when Module test suite is null). Consider changing this to match the TestModuleLocal condition: $isNotAbandonedPR -and ($null -ne $settings.TestSuites.Module) to ensure cleanup only runs when the tests actually execute.

Suggested change
AfterAllModuleLocal = $true # Always runs if Test-ModuleLocal was not skipped
AfterAllModuleLocal = $isNotAbandonedPR -and ($null -ne $settings.TestSuites.Module) # Always runs if Test-ModuleLocal was not skipped

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 11, 2026 11:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 11, 2026 13:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 11, 2026 14:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 11, 2026 14:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 11, 2026 16:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MariusStorhaug MariusStorhaug merged commit 77c3c59 into main Jan 11, 2026
21 checks passed
@MariusStorhaug MariusStorhaug deleted the init branch January 11, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants