-
Notifications
You must be signed in to change notification settings - Fork 0
🩹 [Patch]: Default to built-in Invoke-ScriptAnalyzer settings #19
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 makes the PSScriptAnalyzer settings file optional for the GitHub Action, allowing it to gracefully fall back to default PSScriptAnalyzer rules when no custom settings file is provided or found.
- Implements fallback logic in the main action script to handle missing settings files
- Updates the test framework to support running with optional settings files
- Adds comprehensive test coverage for the default settings scenario
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/main.ps1 | Implements robust settings file resolution with fallback to defaults |
| scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1 | Makes SettingsFilePath parameter optional and adds conditional logic for settings handling |
| .github/workflows/Action-Test.yml | Adds new workflow job to test action behavior with default settings |
| tests/Get-AggregatedStatus.ps1 | Includes new test case for default settings validation |
| README.md | Documents settings file precedence and provides usage examples |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
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 5 out of 5 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.
Co-authored-by: Copilot <[email protected]>
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 5 out of 5 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…o prevent GitHub Actions from interpreting null as "null"
…SettingsFilePath and enhance logging in tests
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 5 out of 5 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.
…t expected outcome for default manifest test
… provided and update output accordingly
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 5 out of 5 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.
Co-authored-by: Copilot <[email protected]>
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 5 out of 5 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.
…s tests and improve settings file path handling in Invoke-ScriptAnalyzer
…ScriptAnalyzer into runWithDefaults
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 7 out of 7 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…redundant checks for clarity
…w and related tests for consistency
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 7 out of 7 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This pull request introduces improved handling of the settings file for the ScriptAnalyzer GitHub Action, adds a new test scenario for default settings, and updates CI workflows and documentation to reflect these changes. The main goals are to make the settings file optional, clarify precedence, and ensure robust testing and reporting.
Key changes:
Settings file handling and usage:
scripts/main.ps1[1]scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1[2] [3] [4]README.md[5]Continuous Integration workflow improvements:
All
actions/checkoutsteps in workflow files now setpersist-credentials: falsefor improved security and consistency. (.github/workflows/Action-Test.yml[1] [2] [3] [4] [5].github/workflows/Auto-Release.yml[6].github/workflows/Linter.yml[7]A new test job,
ActionTestSrcWithManifestDefault, is added to verify the action's behavior when no settings file is present (i.e., default settings are used). The workflow aggregation and environment variable naming are updated for clarity and maintainability. (.github/workflows/Action-Test.yml[1] [2]tests/Get-AggregatedStatus.ps1[3]Documentation and configuration updates:
The README is updated to clearly explain settings file precedence and provide usage examples for all scenarios (custom, default, and none). (
README.mdREADME.mdL91-R125)Linter workflow configuration is updated to include new validation options and disables certain Biome and zizmor validations for clarity. (
.github/workflows/Linter.yml.github/workflows/Linter.ymlR34-R36)