mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
fix: using code blocks within release-notes (#275)
Increase the number of code blocks backticks to 4 for the release note prefix and suffix, to allow users to embed their own code blocks using only 3 backticks.
This commit is contained in:
parent
93bb42e781
commit
612928a382
13 changed files with 229 additions and 103 deletions
7
internal/testdata/changelog-content.txt
vendored
Normal file
7
internal/testdata/changelog-content.txt
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
This is the changelog
|
||||
|
||||
## Awesome
|
||||
|
||||
### New
|
||||
|
||||
#### Changes
|
||||
13
internal/testdata/changelog.txt
vendored
Normal file
13
internal/testdata/changelog.txt
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Foobar
|
||||
|
||||
<!-- section-start changelog -->
|
||||
This is the changelog
|
||||
|
||||
## Awesome
|
||||
|
||||
### New
|
||||
|
||||
#### Changes
|
||||
<!-- section-end changelog -->
|
||||
|
||||
Suffix Things
|
||||
28
internal/testdata/description-no-overrides.txt
vendored
Normal file
28
internal/testdata/description-no-overrides.txt
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<!-- section-start changelog -->
|
||||
## v1.0.0
|
||||
<!-- section-end changelog -->
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary><h4>PR by <a href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a> 🤖</h4></summary>
|
||||
|
||||
If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs.
|
||||
|
||||
## Release Notes
|
||||
|
||||
### Prefix / Start
|
||||
|
||||
This will be added to the start of the release notes.
|
||||
|
||||
~~~~rp-prefix
|
||||
~~~~
|
||||
|
||||
### Suffix / End
|
||||
|
||||
This will be added to the end of the release notes.
|
||||
|
||||
~~~~rp-suffix
|
||||
~~~~
|
||||
|
||||
</details>
|
||||
44
internal/testdata/description-overrides.txt
vendored
Normal file
44
internal/testdata/description-overrides.txt
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<!-- section-start changelog -->
|
||||
## v1.0.0
|
||||
<!-- section-end changelog -->
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary><h4>PR by <a href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a> 🤖</h4></summary>
|
||||
|
||||
If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs.
|
||||
|
||||
## Release Notes
|
||||
|
||||
### Prefix / Start
|
||||
|
||||
This will be added to the start of the release notes.
|
||||
|
||||
~~~~rp-prefix
|
||||
## Foo
|
||||
|
||||
- Cool thing
|
||||
|
||||
```go
|
||||
// Some code example
|
||||
func IsPositive(number int) error {
|
||||
if number < 0 {
|
||||
return fmt.Errorf("number %d is negative", number)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
```
|
||||
~~~~
|
||||
|
||||
### Suffix / End
|
||||
|
||||
This will be added to the end of the release notes.
|
||||
|
||||
~~~~rp-suffix
|
||||
## Compatibility
|
||||
|
||||
No compatibility guarantees.
|
||||
~~~~
|
||||
|
||||
</details>
|
||||
41
internal/testdata/description-prefix.txt
vendored
Normal file
41
internal/testdata/description-prefix.txt
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<!-- section-start changelog -->
|
||||
## v1.0.0
|
||||
<!-- section-end changelog -->
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary><h4>PR by <a href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a> 🤖</h4></summary>
|
||||
|
||||
If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs.
|
||||
|
||||
## Release Notes
|
||||
|
||||
### Prefix / Start
|
||||
|
||||
This will be added to the start of the release notes.
|
||||
|
||||
~~~~rp-prefix
|
||||
## Foo
|
||||
|
||||
- Cool thing
|
||||
|
||||
```go
|
||||
// Some code example
|
||||
func IsPositive(number int) error {
|
||||
if number < 0 {
|
||||
return fmt.Errorf("number %d is negative", number)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
```
|
||||
~~~~
|
||||
|
||||
### Suffix / End
|
||||
|
||||
This will be added to the end of the release notes.
|
||||
|
||||
~~~~rp-suffix
|
||||
~~~~
|
||||
|
||||
</details>
|
||||
31
internal/testdata/description-suffix.txt
vendored
Normal file
31
internal/testdata/description-suffix.txt
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!-- section-start changelog -->
|
||||
## v1.0.0
|
||||
<!-- section-end changelog -->
|
||||
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary><h4>PR by <a href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a> 🤖</h4></summary>
|
||||
|
||||
If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs.
|
||||
|
||||
## Release Notes
|
||||
|
||||
### Prefix / Start
|
||||
|
||||
This will be added to the start of the release notes.
|
||||
|
||||
~~~~rp-prefix
|
||||
~~~~
|
||||
|
||||
### Suffix / End
|
||||
|
||||
This will be added to the end of the release notes.
|
||||
|
||||
~~~~rp-suffix
|
||||
## Compatibility
|
||||
|
||||
No compatibility guarantees.
|
||||
~~~~
|
||||
|
||||
</details>
|
||||
13
internal/testdata/prefix.txt
vendored
Normal file
13
internal/testdata/prefix.txt
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
## Foo
|
||||
|
||||
- Cool thing
|
||||
|
||||
```go
|
||||
// Some code example
|
||||
func IsPositive(number int) error {
|
||||
if number < 0 {
|
||||
return fmt.Errorf("number %d is negative", number)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
```
|
||||
3
internal/testdata/suffix.txt
vendored
Normal file
3
internal/testdata/suffix.txt
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
## Compatibility
|
||||
|
||||
No compatibility guarantees.
|
||||
19
internal/testdata/testdata.go
vendored
Normal file
19
internal/testdata/testdata.go
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package testdata
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"testing"
|
||||
)
|
||||
|
||||
//go:embed *.txt
|
||||
var testdata embed.FS
|
||||
|
||||
func MustReadFileString(t *testing.T, name string) string {
|
||||
t.Helper()
|
||||
|
||||
content, err := testdata.ReadFile(name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return string(content)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue