Skip to content

Commit 239a98d

Browse files
Fix CI failures: remove Test-ModuleManifest, fix lint warnings and table alignment
- Remove Test-ModuleManifest call that fails when RequiredModules are not yet installed (dependencies are resolved in a later step) - Add SuppressMessage attributes for prNumber and prHeadRef variables assigned in LogGroup blocks but used in subsequent blocks - Break long error message line to satisfy PSAvoidLongLines rule - Fix README table pipe alignment (MD060) by shortening ModulePath description to fit within the aligned column width
1 parent 3ca4e18 commit 239a98d

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ This makes the tested artifact identical to the published artifact (see
3939

4040
## Inputs
4141

42-
| Name | Description | Required | Default |
43-
| -------------------------- | ------------------------------------------------------------------------------------------ | -------- | ---------------- |
44-
| `Name` | Name of the module. Defaults to the repository name. | No | Repository name |
45-
| `ModulePath` | Path to the folder that contains the `<Name>/` module subdirectory (e.g. `outputs/module` must contain `outputs/module/<Name>/`). | No | `outputs/module` |
46-
| `APIKey` | PowerShell Gallery API key. | Yes | |
47-
| `AutoCleanup` | Delete prerelease tags matching the PR branch after a stable release. | No | `true` |
48-
| `WhatIf` | Log the changes that would be made without publishing, creating, or deleting anything. | No | `false` |
49-
| `WorkingDirectory` | The working directory where the script will run from. | No | `.` |
50-
| `UsePRTitleAsReleaseName` | Use the PR title as the release name (otherwise the version string is used). | No | `false` |
51-
| `UsePRBodyAsReleaseNotes` | Use the PR body as the release notes (otherwise `--generate-notes` is used). | No | `true` |
52-
| `UsePRTitleAsNotesHeading` | Prefix the release notes with the PR title as an H1 heading linking to the PR. | No | `true` |
42+
| Name | Description | Required | Default |
43+
| -------------------------- | --------------------------------------------------------------------------------------- | -------- | ---------------- |
44+
| `Name` | Name of the module. Defaults to the repository name. | No | Repository name |
45+
| `ModulePath` | Path to the folder containing the `<Name>/` module subdirectory from Build-PSModule. | No | `outputs/module` |
46+
| `APIKey` | PowerShell Gallery API key. | Yes | |
47+
| `AutoCleanup` | Delete prerelease tags matching the PR branch after a stable release. | No | `true` |
48+
| `WhatIf` | Log the changes that would be made without publishing, creating, or deleting anything. | No | `false` |
49+
| `WorkingDirectory` | The working directory where the script will run from. | No | `.` |
50+
| `UsePRTitleAsReleaseName` | Use the PR title as the release name (otherwise the version string is used). | No | `false` |
51+
| `UsePRBodyAsReleaseNotes` | Use the PR body as the release notes (otherwise `--generate-notes` is used). | No | `true` |
52+
| `UsePRTitleAsNotesHeading` | Prefix the release notes with the PR title as an H1 heading linking to the PR. | No | `true` |

src/publish.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
'PSUseDeclaredVarsMoreThanAssignments', 'usePRTitleAsNotesHeading',
1515
Justification = 'Variable is used in script blocks.'
1616
)]
17+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
18+
'PSUseDeclaredVarsMoreThanAssignments', 'prNumber',
19+
Justification = 'Variable is used in script blocks.'
20+
)]
21+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
22+
'PSUseDeclaredVarsMoreThanAssignments', 'prHeadRef',
23+
Justification = 'Variable is used in script blocks.'
24+
)]
1725
[CmdletBinding()]
1826
param()
1927

@@ -70,11 +78,11 @@ LogGroup 'Resolve version from manifest' {
7078

7179
Show-FileContent -Path $manifestFilePath
7280

73-
$manifest = Test-ModuleManifest -Path $manifestFilePath -ErrorAction Stop
7481
$manifestData = Import-PowerShellDataFile -Path $manifestFilePath
7582
$moduleVersion = $manifestData.ModuleVersion
7683
if (-not ($moduleVersion -match '^\d+\.\d+\.\d+$')) {
77-
Write-Error "ModuleVersion [$moduleVersion] must be in Major.Minor.Patch format. Ensure Build-PSModule has stamped the artifact with a final version."
84+
Write-Error ("ModuleVersion [$moduleVersion] must be in Major.Minor.Patch format. " +
85+
'Ensure Build-PSModule has stamped the artifact with a final version.')
7886
exit 1
7987
}
8088
$prerelease = $manifestData.PrivateData.PSData.Prerelease

0 commit comments

Comments
 (0)