Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/linters/.powershell-psscriptanalyzer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}
ExcludeRules = @(
'PSMissingModuleManifestField', # This rule is not applicable until the module is built.
'PSUseToExportFieldsInManifest'
'PSUseToExportFieldsInManifest',
"PSAvoidUsingWriteHost" # Write-Host works well in runners.
)
}
95 changes: 48 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,54 @@ customize rule selection, severity filtering, and custom rule inclusion.

## Inputs

| Input | Description | Required | Default |
|--------------------------------------|--------------------------------------------------------------------------------|----------|-----------------------------------------------------------------------------|
| `Path` | The path to the code to test. | false | `'.'` |
| `SettingsFilePath` | The path to the settings file. | false | `.github/linters/.powershell-psscriptanalyzer.psd1` |
| `Debug` | Enable debug output. | false | `'false'` |
| `Verbose` | Enable verbose output. | false | `'false'` |
| `Version` | Specifies the exact version of the GitHub module to install. | false | |
| `Prerelease` | Allow prerelease versions if available. | false | `'false'` |
| `WorkingDirectory` | The working directory where the script runs. | false | `'.'` |
| `ReportAsJson` | Output generated reports in JSON format in addition to the configured format. | false | `'true'` |
| `StepSummary_Enabled` | Controls if a GitHub step summary should be shown. | false | `'true'` |
| `StepSummary_ShowTestOverview` | Controls whether to show the test overview table in the GitHub step summary. | false | `'true'` |
| `StepSummary_ShowTests` | Controls which tests to show in the GitHub step summary (Full/Failed/None). | false | `'Failed'` |
| `StepSummary_ShowConfiguration` | Controls whether to show the configuration details in the GitHub step summary. | false | `'false'` |
| `Run_ExcludePath` | Directories or files to be excluded from the run. | false | |
| `Run_Exit` | Exit with non-zero exit code when the test run fails. | false | |
| `Run_Throw` | Throw an exception when test run fails. | false | |
| `Run_SkipRun` | Runs the discovery phase but skips run. | false | |
| `Run_SkipRemainingOnFailure` | Skips remaining tests after failure (None/Run/Container/Block). | false | |
| `CodeCoverage_Enabled` | Enable CodeCoverage. | false | |
| `CodeCoverage_OutputFormat` | Format to use for code coverage report (JaCoCo/CoverageGutters/Cobertura). | false | |
| `CodeCoverage_OutputPath` | Path relative to the current directory where code coverage report is saved. | false | |
| `CodeCoverage_OutputEncoding` | Encoding of the output file. | false | |
| `CodeCoverage_Path` | Directories or files to be used for code coverage. | false | |
| `CodeCoverage_ExcludeTests` | Exclude tests from code coverage. | false | |
| `CodeCoverage_RecursePaths` | Will recurse through directories in the Path option. | false | |
| `CodeCoverage_CoveragePercentTarget` | Target percent of code coverage that you want to achieve. | false | |
| `CodeCoverage_UseBreakpoints` | EXPERIMENTAL: Use Profiler based tracer instead of breakpoints when false. | false | |
| `CodeCoverage_SingleHitBreakpoints` | Remove breakpoint when it is hit. | false | |
| `TestResult_Enabled` | Enable TestResult. | false | |
| `TestResult_OutputFormat` | Format to use for test result report (NUnitXml/NUnit2.5/NUnit3/JUnitXml). | false | |
| `TestResult_OutputPath` | Path relative to the current directory where test result report is saved. | false | |
| `TestResult_OutputEncoding` | Encoding of the output file. | false | |
| `TestResult_TestSuiteName` | Set the name assigned to the root 'test-suite' element. | false | `PSScriptAnalyzer` |
| `Should_ErrorAction` | Controls if Should throws on error. Use 'Stop' or 'Continue'. | false | |
| `Debug_ShowFullErrors` | Show full errors including Pester internal stack. | false | |
| `Debug_WriteDebugMessages` | Write Debug messages to screen. | false | |
| `Debug_WriteDebugMessagesFrom` | Write Debug messages from a given source. | false | |
| `Debug_ShowNavigationMarkers` | Write paths after every block and test, for easy navigation. | false | |
| `Debug_ReturnRawResultObject` | Returns unfiltered result object, for development only. | false | |
| `Output_Verbosity` | The verbosity of output (None/Normal/Detailed/Diagnostic). | false | |
| `Output_StackTraceVerbosity` | The verbosity of stacktrace output (None/FirstLine/Filtered/Full). | false | |
| `Output_CIFormat` | The CI format of error output (None/Auto/AzureDevops/GithubActions). | false | |
| `Output_CILogLevel` | The CI log level in build logs (Error/Warning). | false | |
| `Output_RenderMode` | The mode used to render console output (Auto/Ansi/ConsoleColor/Plaintext). | false | |
| `TestDrive_Enabled` | Enable TestDrive. | false | |
| `TestRegistry_Enabled` | Enable TestRegistry. | false | |
| Input | Description | Required | Default |
|--------------------------------------|--------------------------------------------------------------------------------|----------|-----------------------------------------------------|
| `Path` | The path to the code to test. | false | `'.'` |
| `SettingsFilePath` | The path to the settings file. | false | `.github/linters/.powershell-psscriptanalyzer.psd1` |
| `Debug` | Enable debug output. | false | `'false'` |
| `Verbose` | Enable verbose output. | false | `'false'` |
| `Version` | Specifies the exact version of the GitHub module to install. | false | |
| `Prerelease` | Allow prerelease versions if available. | false | `'false'` |
| `WorkingDirectory` | The working directory where the script runs. | false | `'.'` |
| `ReportAsJson` | Output generated reports in JSON format in addition to the configured format. | false | `'true'` |
| `Notice_Mode` | Controls when to show notices for test completion. | false | `'Failed'` |
| `StepSummary_Enabled` | Controls if a GitHub step summary should be shown. | false | `'true'` |
| `StepSummary_ShowTestOverview` | Controls whether to show the test overview table in the GitHub step summary. | false | `'true'` |
| `StepSummary_ShowTests` | Controls which tests to show in the GitHub step summary (Full/Failed/None). | false | `'Failed'` |
| `StepSummary_ShowConfiguration` | Controls whether to show the configuration details in the GitHub step summary. | false | `'false'` |
| `Run_ExcludePath` | Directories or files to be excluded from the run. | false | |
| `Run_Exit` | Exit with non-zero exit code when the test run fails. | false | |
| `Run_Throw` | Throw an exception when test run fails. | false | |
| `Run_SkipRun` | Runs the discovery phase but skips run. | false | |
| `Run_SkipRemainingOnFailure` | Skips remaining tests after failure (None/Run/Container/Block). | false | |
| `CodeCoverage_Enabled` | Enable CodeCoverage. | false | |
| `CodeCoverage_OutputFormat` | Format to use for code coverage report (JaCoCo/CoverageGutters/Cobertura). | false | |
| `CodeCoverage_OutputPath` | Path relative to the current directory where code coverage report is saved. | false | |
| `CodeCoverage_OutputEncoding` | Encoding of the output file. | false | |
| `CodeCoverage_Path` | Directories or files to be used for code coverage. | false | |
| `CodeCoverage_ExcludeTests` | Exclude tests from code coverage. | false | |
| `CodeCoverage_RecursePaths` | Will recurse through directories in the Path option. | false | |
| `CodeCoverage_CoveragePercentTarget` | Target percent of code coverage that you want to achieve. | false | |
| `CodeCoverage_UseBreakpoints` | EXPERIMENTAL: Use Profiler based tracer instead of breakpoints when false. | false | |
| `CodeCoverage_SingleHitBreakpoints` | Remove breakpoint when it is hit. | false | |
| `TestResult_Enabled` | Enable TestResult. | false | |
| `TestResult_OutputFormat` | Format to use for test result report (NUnitXml/NUnit2.5/NUnit3/JUnitXml). | false | |
| `TestResult_OutputPath` | Path relative to the current directory where test result report is saved. | false | |
| `TestResult_OutputEncoding` | Encoding of the output file. | false | |
| `TestResult_TestSuiteName` | Set the name assigned to the root 'test-suite' element. | false | `PSScriptAnalyzer` |
| `Should_ErrorAction` | Controls if Should throws on error. Use 'Stop' or 'Continue'. | false | |
| `Debug_ShowFullErrors` | Show full errors including Pester internal stack. | false | |
| `Debug_WriteDebugMessages` | Write Debug messages to screen. | false | |
| `Debug_WriteDebugMessagesFrom` | Write Debug messages from a given source. | false | |
| `Debug_ShowNavigationMarkers` | Write paths after every block and test, for easy navigation. | false | |
| `Debug_ReturnRawResultObject` | Returns unfiltered result object, for development only. | false | |
| `Output_Verbosity` | The verbosity of output (None/Normal/Detailed/Diagnostic). | false | |
| `Output_StackTraceVerbosity` | The verbosity of stacktrace output (None/FirstLine/Filtered/Full). | false | |
| `Output_CIFormat` | The CI format of error output (None/Auto/AzureDevops/GithubActions). | false | |
| `Output_CILogLevel` | The CI log level in build logs (Error/Warning). | false | |
| `Output_RenderMode` | The mode used to render console output (Auto/Ansi/ConsoleColor/Plaintext). | false | |
| `TestDrive_Enabled` | Enable TestDrive. | false | |
| `TestRegistry_Enabled` | Enable TestRegistry. | false | |

## Outputs

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ inputs:
Output generated reports in JSON format in addition to the configured format through Pester.
required: false
default: 'true'
Notice_Mode:
description: |
Controls when to show notices for test completion. Allows "Full" (show on success and failure), "Failed" (show only on failure), or "None" (disable notices).
required: false
default: 'Failed'
StepSummary_ShowTestOverview:
description: |
Controls whether to show the test overview table in the GitHub step summary.
Expand Down Expand Up @@ -271,6 +276,7 @@ runs:
Path: ${{ github.action_path }}/scripts/tests/PSScriptAnalyzer
Run_Path: ${{ fromJson(steps.paths.outputs.result).CodePath }}
ReportAsJson: ${{ inputs.ReportAsJson }}
Notice_Mode: ${{ inputs.Notice_Mode }}
StepSummary_ShowTestOverview: ${{ inputs.StepSummary_ShowTestOverview }}
StepSummary_Mode: ${{ inputs.StepSummary_Mode }}
StepSummary_ShowConfiguration: ${{ inputs.StepSummary_ShowConfiguration }}
Expand Down
Loading
Loading