-
Notifications
You must be signed in to change notification settings - Fork 0
🚀[Feature]: Use local PSScriptAnalyzer files #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 |
There was a problem hiding this 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.
There was a problem hiding this 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.
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-ScriptAnalyzeraction from v3 to v4 in linting workflows (Lint-SourceCode.ymlandTest-Module.yml). This version automatically discovers and uses local.powershell-psscriptanalyzer.psd1configuration files from the.github/linters/directory, providing better support for repository-specific linting rules.Removed Deprecated Settings Parameter
The
Settingsparameter has been removed from bothLint-SourceCodeandLint-Moduleworkflow steps. PSScriptAnalyzer now automatically discovers local configuration files, eliminating the need to explicitly specify settings profiles.Workflow Configuration Improvements
Checkout repositorystep to theLint-Modulejob to ensure the codebase (including local configuration files) is available before lintingfetch-depth: 0from checkout steps to use shallow clones, reducing workflow execution timeNameparameter from test workflowCustom Linting Configuration Support
Added a
.powershell-psscriptanalyzer.psd1configuration 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.