Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Oct 11, 2025

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.

@MariusStorhaug MariusStorhaug requested a review from a team as a code owner October 11, 2025 15:39
Copilot AI review requested due to automatic review settings October 11, 2025 15:39
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 pull request updates GitHub Actions workflows to use a newer version of the PSScriptAnalyzer action and removes explicit Settings parameters to rely on local configuration files.

  • Updated PSModule/Invoke-ScriptAnalyzer action from v3 to v4 in both workflows
  • Removed explicit Settings parameters ("Module" and "SourceCode") to allow v4 to auto-detect local PSScriptAnalyzer configuration files

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/Test-Module.yml Updated action version and removed Settings parameter for module linting
.github/workflows/Lint-SourceCode.yml Updated action version and removed Settings parameter for source code linting

Copilot AI review requested due to automatic review settings October 11, 2025 19: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

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

Copilot AI review requested due to automatic review settings October 11, 2025 21:18
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 4 out of 4 changed files in this pull request and generated no new comments.

@MariusStorhaug MariusStorhaug self-assigned this Oct 11, 2025
@MariusStorhaug MariusStorhaug merged commit c774534 into main Oct 11, 2025
67 of 68 checks passed
@MariusStorhaug MariusStorhaug deleted the pssa_v4 branch October 11, 2025 22:06
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