feat: edit commit message after merging through PR (#43)

Closes #5
This commit is contained in:
Julian Tölle 2024-09-06 23:17:06 +02:00 committed by GitHub
parent 36a0b90bcd
commit 2effe5e72d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 420 additions and 40 deletions

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c28226eaa769033a45ca801f1e0655178faf86e7ddd764f470ae79d72c4b3c2
size 62031

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:04ca48b3250862d282dd54e14c08f9273ada0a49d2300364601799c56b1f6d11
size 72105

View file

@ -4,7 +4,34 @@ You can customize the generated Release Notes in two ways:
## For a single commit / pull request
This feature is still being worked on. Check out [#5](https://github.com/apricote/releaser-pleaser/issues/5) for the current status.
### Editing the Release Notes
After merging a non-release pull request, you can still modify how it appears in the Release Notes.
To do this, add a code block named `rp-commits` in the pull request description. When this block is present, `releaser-pleaser` will use its content for generating Release Notes instead of the commit message. If the code block contains multiple lines, each line will be treated as if it came from separate pull requests. This is useful for pull requests that introduce multiple features or fix several bugs.
You can update the description at any time after merging the pull request but before merging the release pull request. `releaser-pleaser` will then re-run and update the suggested Release Notes accordingly.
> ```rp-commits
> feat(api): add movie endpoints
> feat(api): add cinema endpoints
> fix(db): invalid schema for actor model
> ```
Using GitHub as an example, the pull request you are trying to change the Release Notes for should look like this:
![Screenshot of a pull request page on GitHub. Currently editing the description of the pull request and adding the rp-commits snippet from above.](release-notes-rp-commits.png)
In turn, `releaser-pleaser` updates the release pull request like this:
![Screenshot of a release pull request on GitHub. It shows the release notes with the three commits from the rp-commits example.](release-notes-rp-commits-release-pr.png)
### Removing the pull request from the Release Notes
If you add an empty code block, the pull request will be removed from the Release Notes.
> ```rp-commits
> ```
## For the release

View file

@ -28,6 +28,20 @@ Adding more than one of these labels is not allowed and the behaviour if multipl
Any text in code blocks with these languages is being added to the start or end of the Release Notes and Changelog. Learn more in the [Release Notes](../guides/release-notes.md) guide.
**Examples**:
```rp-prefix
#### Awesome new feature!
This text is at the start of the release notes.
```
```rp-suffix
#### Version Compatibility
And this at the end.
```
### Status
**Labels**:
@ -43,4 +57,19 @@ Users should not set these labels themselves.
Not created by `releaser-pleaser`.
Normal pull requests do not support any options right now.
### Release Notes
**Code Blocks**:
- `rp-commits`
If specified, `releaser-pleaser` will consider each line in the code block as a commit message and add all of them to the Release Notes. Learn more in the [Release Notes](../guides/release-notes.md) guide.
The types of commits (`feat`, `fix`, ...) are also considered for the next version.
**Examples**:
```rp-commits
feat(api): add movie endpoints
fix(db): invalid schema for actor model
```