Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Oct 11, 2025

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:

  • The action now treats the settings file as optional; if not provided or not found, it falls back to ScriptAnalyzer defaults. Settings file precedence is clarified and documented, and code is updated to handle missing files gracefully without throwing errors. (scripts/main.ps1 [1] scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1 [2] [3] [4] README.md [5]

Continuous Integration workflow improvements:

  • All actions/checkout steps in workflow files now set persist-credentials: false for 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.md README.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)

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

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

Copilot AI review requested due to automatic review settings October 11, 2025 16:57
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 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"
Copilot AI review requested due to automatic review settings October 11, 2025 17:38
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 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.

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

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.

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

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

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

@MariusStorhaug MariusStorhaug merged commit 24cac04 into main Oct 11, 2025
22 checks passed
@MariusStorhaug MariusStorhaug deleted the runWithDefaults branch October 11, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants