Skip to content

🩹 [Patch]: Add basic GitHub-Script inputs #4

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

Merged
merged 1 commit into from
Feb 23, 2025
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ customize rule selection, severity filtering, and custom rule inclusion.

| Input | Description | Required | Default |
|---------------------|----------------------------------------------------------------|----------|-----------------------------------------------------------------------------|
| **Path** | The path to the code to test. | No | `${{ github.workspace }}` |
| **Settings** | The type of tests to run: `Module`, `SourceCode`, or `Custom`. | No | `Custom` |
| **SettingsFilePath**| If `Custom` is selected, the path to the settings file. | No | `${{ github.workspace }}/.github/linters/.powershell-psscriptanalyzer.psd1` |
| `Path` | The path to the code to test. | false | `${{ github.workspace }}` |
| `Settings` | The type of tests to run: `Module`, `SourceCode`, or `Custom`. | false | `Custom` |
| `SettingsFilePath` | If `Custom` is selected, the path to the settings file. | false | `${{ github.workspace }}/.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'` |

## Outputs

Expand Down
23 changes: 23 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ inputs:
description: If 'Custom' is selected, the path to the settings file.
required: false
default: ${{ github.workspace }}/.github/linters/.powershell-psscriptanalyzer.psd1
Debug:
description: Enable debug output.
required: false
default: 'false'
Verbose:
description: Enable verbose output.
required: false
default: 'false'
Version:
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
required: false
Prerelease:
description: Allow prerelease versions if available.
required: false
default: 'false'

runs:
using: composite
Expand All @@ -30,6 +45,10 @@ runs:
GITHUB_ACTION_INVOKE_SCRIPTANALYZER_INPUT_Settings: ${{ inputs.Settings }}
GITHUB_ACTION_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath: ${{ inputs.SettingsFilePath }}
with:
Debug: ${{ inputs.Debug }}
Prerelease: ${{ inputs.Prerelease }}
Verbose: ${{ inputs.Verbose }}
Version: ${{ inputs.Version }}
Script: ${{ github.action_path }}/scripts/main.ps1

- name: Invoke-Pester
Expand All @@ -39,6 +58,10 @@ runs:
Settings: ${{ fromJson(steps.paths.outputs.result).Settings }}
SettingsFilePath: ${{ fromJson(steps.paths.outputs.result).SettingsFilePath }}
with:
Debug: ${{ inputs.Debug }}
Prerelease: ${{ inputs.Prerelease }}
Verbose: ${{ inputs.Verbose }}
Version: ${{ inputs.Version }}
TestResult_TestSuiteName: PSScriptAnalyzer
Path: ${{ github.action_path }}/scripts/tests/PSScriptAnalyzer
Run_Path: ${{ inputs.Path }}