Skip to content

Commit 72f0486

Browse files
🩹 [Patch]: Add example section for configuring PR-based release notes in README.md
1 parent 9ca17a5 commit 72f0486

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

‎README.md‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
7676
- [Configuring Linter Validation Rules](#configuring-linter-validation-rules)
7777
- [Additional Configuration](#additional-configuration)
7878
- [Showing Linter Summary on Success](#showing-linter-summary-on-success)
79+
- [Example 4 - Configuring PR-based release notes](#example-4---configuring-pr-based-release-notes)
80+
- [Default configuration (recommended)](#default-configuration-recommended)
81+
- [Version-only release names](#version-only-release-names)
82+
- [Auto-generated notes](#auto-generated-notes)
7983
- [Skipping Individual Framework Tests](#skipping-individual-framework-tests)
8084
- [How to Skip Tests](#how-to-skip-tests)
8185
- [Available Framework Tests](#available-framework-tests)
@@ -581,6 +585,71 @@ This is useful for reviewing what was checked even when no issues are found.
581585
For a complete list of available environment variables and configuration options, see the
582586
[super-linter environment variables documentation](https://github.com/super-linter/super-linter#environment-variables).
583587

588+
### Example 4 - Configuring PR-based release notes
589+
590+
The workflow can automatically generate GitHub release names and notes from your pull request content.
591+
Three parameters control this behavior:
592+
593+
| Parameter | Description |
594+
|-----------|-------------|
595+
| `UsePRTitleAsReleaseName` | Use the PR title as the GitHub release name instead of the version string |
596+
| `UsePRBodyAsReleaseNotes` | Use the PR body as the release notes content |
597+
| `UsePRTitleAsNotesHeading` | Prepend PR title as H1 heading with PR number link before the body |
598+
599+
These parameters follow specific precedence rules when building release notes:
600+
601+
1. **Heading + Body** (`UsePRTitleAsNotesHeading: true` + `UsePRBodyAsReleaseNotes: true`): Creates formatted notes with the PR title as an H1 heading followed by the PR body. The output format is `# PR Title (#123)\n\nPR body content`. Both the PR title and body must be present.
602+
603+
1. **Body only** (`UsePRBodyAsReleaseNotes: true`): Uses the PR body as-is for release notes. Takes effect when heading option is disabled or PR title is missing.
604+
605+
1. **Fallback**: When neither option is enabled or required PR content is missing, GitHub's auto-generated release notes are used via `--generate-notes`.
606+
607+
#### Default configuration (recommended)
608+
609+
The defaults provide rich release notes with the PR title as a heading:
610+
611+
```yaml
612+
Publish:
613+
Module:
614+
UsePRTitleAsReleaseName: false
615+
UsePRBodyAsReleaseNotes: true
616+
UsePRTitleAsNotesHeading: true
617+
```
618+
619+
This produces release notes like:
620+
621+
```markdown
622+
# 🚀 Add new authentication feature (#42)
623+
624+
This PR adds OAuth2 support with the following changes:
625+
- Added `Connect-OAuth2` function
626+
- Updated documentation
627+
```
628+
629+
#### Version-only release names
630+
631+
If you prefer version numbers as release names but still want PR-based notes:
632+
633+
```yaml
634+
Publish:
635+
Module:
636+
UsePRTitleAsReleaseName: false
637+
UsePRBodyAsReleaseNotes: true
638+
UsePRTitleAsNotesHeading: false
639+
```
640+
641+
#### Auto-generated notes
642+
643+
To use GitHub's auto-generated release notes instead of PR content:
644+
645+
```yaml
646+
Publish:
647+
Module:
648+
UsePRTitleAsReleaseName: false
649+
UsePRBodyAsReleaseNotes: false
650+
UsePRTitleAsNotesHeading: false
651+
```
652+
584653
## Skipping Individual Framework Tests
585654
586655
The PSModule framework tests run automatically as part of the `Test-Module` and `Test-SourceCode` jobs. While you can skip entire test categories using the configuration settings (e.g., `Test.PSModule.Skip`), you can also skip individual framework tests on a per-file basis when needed.

0 commit comments

Comments
 (0)