Skip to content

Conversation

@MariusStorhaug
Copy link
Member

Description

This pull request simplifies the configuration of the script analyzer action by removing the Settings input (which previously allowed selecting between Module, SourceCode, or Custom modes) in favor of always using a SettingsFilePath. Documentation, workflow, and implementation are updated to reflect this streamlined approach. Additionally, a new example settings file for source code analysis is added for clarity.

Configuration and API Simplification:

  • Removed the Settings input from action.yml, the workflow, and environment variables, so users now always specify a SettingsFilePath for analyzer configuration. The default settings file path is now .github/linters/.powershell-psscriptanalyzer.psd1. [1] [2] [3] [4] [5] [6] [7]

Documentation Updates:

  • Updated README.md to remove references to the old Settings input and predefined settings types, clarifying that users should provide a settings file via SettingsFilePath. Usage instructions and examples are revised accordingly. [1] [2] [3]

Implementation Changes:

  • Refactored scripts/main.ps1 to resolve only the SettingsFilePath and validate its existence, removing all logic related to the Settings input and its switch statement.

Test and Example Improvements:

  • Added a new tests/srcWithManifestTestRepo/tests/SourceCode.Settings.psd1 file containing example analyzer rules for source code analysis.

@MariusStorhaug MariusStorhaug self-assigned this Oct 11, 2025
Copilot AI review requested due to automatic review settings October 11, 2025 15: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

This PR simplifies the PSScriptAnalyzer action configuration by removing the predefined Settings input modes and standardizing on a single SettingsFilePath approach. Users now always provide a custom settings file path instead of choosing between Module, SourceCode, or Custom modes.

  • Removed the Settings input parameter and its associated logic throughout the codebase
  • Updated default settings file path to be relative instead of absolute
  • Added an example SourceCode settings file for testing purposes

Reviewed Changes

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

Show a summary per file
File Description
action.yml Removed Settings input and updated SettingsFilePath description and default
scripts/main.ps1 Simplified logic to only handle SettingsFilePath resolution and validation
README.md Updated documentation to reflect Settings input removal and new workflow
.github/workflows/Action-Test.yml Updated test workflows to use SettingsFilePath instead of Settings
tests/srcWithManifestTestRepo/tests/SourceCode.Settings.psd1 Added example settings file for source code analysis
Comments suppressed due to low confidence (1)

action.yml:1

  • The default path should include ${{ github.workspace }}/ prefix to ensure the path is resolved relative to the repository root, maintaining consistency with the README documentation which still references the full path.
name: Invoke-ScriptAnalyzer (by PSModule)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings October 11, 2025 15: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 5 out of 7 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 11, 2025 15:16
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 5 out of 7 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MariusStorhaug MariusStorhaug changed the title Remove Settings with predefined settings 🌟[Major]: Remove Settings with predefined settings Oct 11, 2025
Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings October 11, 2025 15:29
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 5 out of 7 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MariusStorhaug MariusStorhaug merged commit 1783982 into main Oct 11, 2025
21 of 24 checks passed
@MariusStorhaug MariusStorhaug deleted the simplify branch October 11, 2025 15:35
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