Skip to content

Commit ce4aac7

Browse files
🚀 [Feature]: Add PR-based release notes settings (#5)
The settings action now supports three new configuration options that control how GitHub release notes are generated from pull requests. - Relates to PSModule/Process-PSModule#263 ## New settings schema The following settings are now available in the `Publish.Module` section of your `.github/PSModule.yml`: | Setting | Type | Default | Description | |---------|------|---------|-------------| | `UsePRTitleAsReleaseName` | `boolean` | `false` | Use pull request title as the GitHub release name | | `UsePRBodyAsReleaseNotes` | `boolean` | `true` | Use pull request body as the release notes content | | `UsePRTitleAsNotesHeading` | `boolean` | `true` | Add pull request title as H1 heading in release notes | ## Schema changes The JSON schema in [scripts/Settings.schema.json](scripts/Settings.schema.json) has been updated to include the new properties with proper type definitions and descriptions. ## Default values The [scripts/main.ps1](scripts/main.ps1) file now outputs these settings with sensible defaults: - `UsePRTitleAsReleaseName`: `false` (release name uses version tag) - `UsePRBodyAsReleaseNotes`: `true` (PR body becomes release notes) - `UsePRTitleAsNotesHeading`: `true` (PR title appears as heading with PR link)
1 parent 5be8144 commit ce4aac7

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

scripts/Settings.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@
161161
"IgnoreLabels": {
162162
"type": "string",
163163
"description": "Comma-separated labels that prevent release"
164+
},
165+
"UsePRTitleAsReleaseName": {
166+
"type": "boolean",
167+
"description": "Use pull request title as the GitHub release name"
168+
},
169+
"UsePRBodyAsReleaseNotes": {
170+
"type": "boolean",
171+
"description": "Use pull request body as the release notes content"
172+
},
173+
"UsePRTitleAsNotesHeading": {
174+
"type": "boolean",
175+
"description": "Add pull request title as H1 heading in release notes"
164176
}
165177
}
166178
}

scripts/main.ps1

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,19 @@ $settings = [pscustomobject]@{
162162
}
163163
Publish = [pscustomobject]@{
164164
Module = [pscustomobject]@{
165-
Skip = $settings.Publish.Module.Skip ?? $false
166-
AutoCleanup = $settings.Publish.Module.AutoCleanup ?? $true
167-
AutoPatching = $settings.Publish.Module.AutoPatching ?? $true
168-
IncrementalPrerelease = $settings.Publish.Module.IncrementalPrerelease ?? $true
169-
DatePrereleaseFormat = $settings.Publish.Module.DatePrereleaseFormat ?? ''
170-
VersionPrefix = $settings.Publish.Module.VersionPrefix ?? 'v'
171-
MajorLabels = $settings.Publish.Module.MajorLabels ?? 'major, breaking'
172-
MinorLabels = $settings.Publish.Module.MinorLabels ?? 'minor, feature'
173-
PatchLabels = $settings.Publish.Module.PatchLabels ?? 'patch, fix'
174-
IgnoreLabels = $settings.Publish.Module.IgnoreLabels ?? 'NoRelease'
165+
Skip = $settings.Publish.Module.Skip ?? $false
166+
AutoCleanup = $settings.Publish.Module.AutoCleanup ?? $true
167+
AutoPatching = $settings.Publish.Module.AutoPatching ?? $true
168+
IncrementalPrerelease = $settings.Publish.Module.IncrementalPrerelease ?? $true
169+
DatePrereleaseFormat = $settings.Publish.Module.DatePrereleaseFormat ?? ''
170+
VersionPrefix = $settings.Publish.Module.VersionPrefix ?? 'v'
171+
MajorLabels = $settings.Publish.Module.MajorLabels ?? 'major, breaking'
172+
MinorLabels = $settings.Publish.Module.MinorLabels ?? 'minor, feature'
173+
PatchLabels = $settings.Publish.Module.PatchLabels ?? 'patch, fix'
174+
IgnoreLabels = $settings.Publish.Module.IgnoreLabels ?? 'NoRelease'
175+
UsePRTitleAsReleaseName = $settings.Publish.Module.UsePRTitleAsReleaseName ?? $false
176+
UsePRBodyAsReleaseNotes = $settings.Publish.Module.UsePRBodyAsReleaseNotes ?? $true
177+
UsePRTitleAsNotesHeading = $settings.Publish.Module.UsePRTitleAsNotesHeading ?? $true
175178
}
176179
}
177180
Linter = [pscustomobject]@{

0 commit comments

Comments
 (0)