Skip to content

v5.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 22:07
· 4 commits to main since this release
c774534

🚀[Feature]: Use local PSScriptAnalyzer files (#228)

The workflow now uses Invoke-ScriptAnalyzer@v4, enabling automatic discovery of local PSScriptAnalyzer configuration files. This allows projects to maintain custom linting rules in their repository without requiring centralized settings management. The upgrade also streamlines workflow configuration by removing deprecated parameters and improving checkout efficiency.

Updated to PSScriptAnalyzer v4

Upgraded the PSModule/Invoke-ScriptAnalyzer action from v3 to v4 in linting workflows (Lint-SourceCode.yml and Test-Module.yml). This version automatically discovers and uses local .powershell-psscriptanalyzer.psd1 configuration files from the .github/linters/ directory, providing better support for repository-specific linting rules.

Removed Deprecated Settings Parameter

The Settings parameter has been removed from both Lint-SourceCode and Lint-Module workflow steps. PSScriptAnalyzer now automatically discovers local configuration files, eliminating the need to explicitly specify settings profiles.

Workflow Configuration Improvements

  • Added a Checkout repository step to the Lint-Module job to ensure the codebase (including local configuration files) is available before linting
  • Removed fetch-depth: 0 from checkout steps to use shallow clones, reducing workflow execution time
  • Removed unused Name parameter from test workflow

Custom Linting Configuration Support

Added a .powershell-psscriptanalyzer.psd1 configuration file in the test repository (tests/srcWithManifestTestRepo/.github/linters/) demonstrating how projects can define custom code style rules, including formatting preferences, line length limits, and rule exclusions.