Skip to content

Commit 342f68b

Browse files
Split version/prerelease into Pester and GitHub inputs
Add PesterVersion/PesterPrerelease and rename Version/Prerelease to GitHubVersion/GitHubPrerelease so Pester and GitHub module versions can be controlled independently and trickle down to the Invoke-Pester and GitHub-Script steps.
1 parent 49e6aae commit 342f68b

2 files changed

Lines changed: 25 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ customize rule selection, severity filtering, and custom rule inclusion.
2121
| `SettingsFilePath` | The path to the settings file. | false | `.github/linters/.powershell-psscriptanalyzer.psd1` |
2222
| `Debug` | Enable debug output. | false | `'false'` |
2323
| `Verbose` | Enable verbose output. | false | `'false'` |
24-
| `Version` | Specifies the exact version of the GitHub module to install. | false | |
25-
| `Prerelease` | Allow prerelease versions if available. | false | `'false'` |
24+
| `PesterVersion` | Specifies the version of the Pester module to install (NuGet range). | false | |
25+
| `PesterPrerelease` | Allow prerelease versions of the Pester module if available. | false | `'false'` |
26+
| `GitHubVersion` | Specifies the version of the GitHub module to install (NuGet range). | false | |
27+
| `GitHubPrerelease` | Allow prerelease versions of the GitHub module if available. | false | `'false'` |
2628
| `WorkingDirectory` | The working directory where the script runs. | false | `'.'` |
2729
| `ReportAsJson` | Output generated reports in JSON format in addition to the configured format. | false | `'true'` |
2830
| `Notice_Mode` | Controls when to show notices for test completion. | false | `'Failed'` |

action.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ inputs:
2121
description: Enable verbose output.
2222
required: false
2323
default: 'false'
24-
Version:
25-
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
24+
PesterVersion:
25+
description: |
26+
Specifies the version of the Pester module to install, using NuGet version-range syntax (for example '[6.0.0,7.0.0)').
27+
When empty, the latest available version is installed.
28+
required: false
29+
PesterPrerelease:
30+
description: Allow prerelease versions of the Pester module if available.
31+
required: false
32+
default: 'false'
33+
GitHubVersion:
34+
description: |
35+
Specifies the version of the GitHub module to install, using NuGet version-range syntax (for example '[1.2.0, 2.0.0)').
36+
When empty, the latest available version is installed.
2637
required: false
27-
Prerelease:
28-
description: Allow prerelease versions if available.
38+
GitHubPrerelease:
39+
description: Allow prerelease versions of the GitHub module if available.
2940
required: false
3041
default: 'false'
3142
WorkingDirectory:
@@ -255,9 +266,9 @@ runs:
255266
PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath: ${{ inputs.SettingsFilePath }}
256267
with:
257268
Debug: ${{ inputs.Debug }}
258-
Prerelease: ${{ inputs.Prerelease }}
269+
Prerelease: ${{ inputs.GitHubPrerelease }}
259270
Verbose: ${{ inputs.Verbose }}
260-
Version: ${{ inputs.Version }}
271+
Version: ${{ inputs.GitHubVersion }}
261272
WorkingDirectory: ${{ inputs.WorkingDirectory }}
262273
Script: ${{ github.action_path }}/src/main.ps1
263274

@@ -268,9 +279,11 @@ runs:
268279
SettingsFilePath: ${{ fromJson(steps.paths.outputs.result).SettingsFilePath }}
269280
with:
270281
Debug: ${{ inputs.Debug }}
271-
GitHubPrerelease: ${{ inputs.Prerelease }}
272-
GitHubVersion: ${{ inputs.Version }}
282+
GitHubPrerelease: ${{ inputs.GitHubPrerelease }}
283+
GitHubVersion: ${{ inputs.GitHubVersion }}
284+
Prerelease: ${{ inputs.PesterPrerelease }}
273285
Verbose: ${{ inputs.Verbose }}
286+
Version: ${{ inputs.PesterVersion }}
274287
WorkingDirectory: ${{ inputs.WorkingDirectory }}
275288
TestResult_TestSuiteName: ${{ inputs.TestResult_TestSuiteName }}
276289
Path: ${{ github.action_path }}/src/tests/PSScriptAnalyzer

0 commit comments

Comments
 (0)